diff options
-rwxr-xr-x | pyAggr3g470r.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 3e26326b..f928b089 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -36,6 +36,7 @@ import threading from collections import Counter from BeautifulSoup import BeautifulSoup +from datetime import date import utils import feedgetter @@ -563,6 +564,13 @@ class Root: html += """<a href="/mail_notification/0:%s">Stop</a> receiving articles from this feed.</p>""" % \ (feed.feed_id, ) + first_article = utils.string_to_datetime(feed.articles.values()[0].article_date) + last_article = utils.string_to_datetime(feed.articles.values()[-1].article_date) + delta = first_article - last_article + delta_today = date.today() - last_article + html += "<p>The last article was posted " + str(abs(delta_today.days)) + " day(s) ago.</p>" + html += "<p>Daily average: " + str(abs(delta.days)/feed.nb_articles) + "</p>\n" + html += "<br /><h1>Recent articles</h1>" for article in feed.articles.values()[:10]: if article.article_readed == "0": |