diff options
author | cedricbonhomme <devnull@localhost> | 2010-11-23 11:40:56 +0100 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2010-11-23 11:40:56 +0100 |
commit | 6b4eff20bea59339a5f09d807e082fc2a494dd7e (patch) | |
tree | 300a8852fa05f7bb48571b0bd36c3c25d6263410 /feedgetter.py | |
parent | Renamed pages list_notification and list_favorites to notifications and favor... (diff) | |
download | newspipe-6b4eff20bea59339a5f09d807e082fc2a494dd7e.tar.gz newspipe-6b4eff20bea59339a5f09d807e082fc2a494dd7e.tar.bz2 newspipe-6b4eff20bea59339a5f09d807e082fc2a494dd7e.zip |
Improvement of mail notification for new articles (HTML output).
Diffstat (limited to 'feedgetter.py')
-rwxr-xr-x | feedgetter.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/feedgetter.py b/feedgetter.py index 6dc69cf8..9143de33 100755 --- a/feedgetter.py +++ b/feedgetter.py @@ -131,6 +131,7 @@ class FeedGetter(object): description = "" try: + # try. Will only success if the article is not already in the data base self.c.execute('insert into articles values (?, ?, ?, ?, ?, ?, ?)', (\ datetime(*article.updated_parsed[:6]), \ utils.clear_string(article.title.encode('utf-8')), \ @@ -142,17 +143,18 @@ class FeedGetter(object): result = self.c.execute("SELECT mail from feeds WHERE feed_site_link='" + \ a_feed.feed.link.encode('utf-8') + "'").fetchall() if result[0][0] == "1": + # if subscribed to the current feed # send the article by e-mail try: - threading.Thread(None, utils.send_mail, \ - None, (utils.mail_from, utils.mail_to, \ - a_feed.feed.title.encode('utf-8'), description) \ + threading.Thread(None, utils.send_mail, None, (utils.mail_from, utils.mail_to, \ + a_feed.feed.title.encode('utf-8'), \ + utils.clear_string(article.title.encode('utf-8')), description) \ ).start() except Exception, e: # SMTP acces denied, to many SMTP connections, etc. print e except sqlite3.IntegrityError: - # article already in the base + # article already in the data base pass except: # Missing information (updated_parsed, ...) |