diff --git a/atomstrom.py b/atomstrom.py index 56ff5dd..d44b4c3 100755 --- a/atomstrom.py +++ b/atomstrom.py @@ -148,13 +148,17 @@ def get_entry_text(entry): def mail_daily_digest(): print 'mailing daily digest...' sender = 'atomstrom' - subject = '[atomstrom]' body = '' + count = 0 for feed, feedinfo, entry in session.query(Feed, Feedinfo, Entry).filter(Feed.id==Feedinfo.feed_id).filter(Feed.id==Entry.feed_id).filter(Feed.enabled==1).filter(Feed.daily==1).order_by(Entry.firstfetched).all(): - body = body + '=> %s - %s\n' % (feedinfo.title, entry.title) + count = count + 1 + body = body + '=> %s - %s\n' % (entry.firstfetched.strftime('%y%m%d-%H%M'), feedinfo.title) + body = body + ' %s\n' % entry.title body = body + get_entry_text(entry)[0:100] body = body + '\n' body = body + 'link: [%s]\n\n' % entry.link + today = datetime.datetime.now() + subject = '[atomstrom] %s (%s) - %d entries' % (today.strftime('%y%m%d'), today.strftime('%A'), count) send_mail(sender, subject, body) def mail_single_entry(feed, feedinfo, entry):