Mercurial > hg > Feedworm
diff FeedUpdater.py @ 5:bfd47f55d85b
add the updated date of the feed
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Mon, 26 Apr 2010 20:46:37 +0200 |
parents | e0199f383442 |
children | 215c34f61e95 |
line wrap: on
line diff
--- a/FeedUpdater.py Mon Apr 26 19:33:07 2010 +0200 +++ b/FeedUpdater.py Mon Apr 26 20:46:37 2010 +0200 @@ -1,4 +1,5 @@ +from datetime import datetime from Feed import Feed from FeedEntry import FeedEntry import feedparser @@ -25,6 +26,11 @@ self.createFeedEntry(entry) def createFeedEntry(self, entry): - newEntry = FeedEntry(id=entry.id, url=entry.link, title=entry.title, summary=entry.summary) - newEntry.feed = self.feed - self.session.add(newEntry) + new = FeedEntry() + new.id = entry.id + new.link = entry.link + new.title = entry.title + new.updated = datetime(*entry.updated_parsed[:6]) + new.summary = entry.summary + new.feed = self.feed + self.session.add(new)