Skip to content

Commit 0161fb6

Browse files
flake8
1 parent d213a37 commit 0161fb6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

email_feed/gmail_feed.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
r = requests.get(URL)
1010

1111
if r.status_code == 401:
12-
print("login [%s] or password [%s] is incorrect\n%s" % (username, password,
13-
'Also try enable "Allow less secure apps" on https://myaccount.google.com/lesssecureapps and |Gmail Settings -> Forwarding and POP / IMAP -> IMAP Acess to Enable IMAP| '))
12+
print("login [%s] or password [%s] is incorrect\n%s" % (username, password, 'Error'))
1413
elif r.status_code != 200:
1514
print("Requests error [%s] - %s" % (r.status_code, URL))
1615
elif r.status_code == 200:
@@ -21,7 +20,7 @@
2120
key_words1 = re.findall('unsusbscribe', text)
2221
key_words2 = re.findall('Stop these mails', text)
2322
keys = key_words1 + key_words2
24-
urls = re.findall('''(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-&?=%.]+''', text)
23+
urls = re.findall(r'''(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-&?=%.]+''', text)
2524
if len(keys) > 0 and len(urls)> 0:
2625
print(a['feed']['entry'][k]['title'])
2726
print(a['feed']['entry'][k]['summary'][0:50])

0 commit comments

Comments
 (0)