Ticket #3759: update_feeds.diff
File update_feeds.diff, 1.3 KB (added by , 18 years ago) |
---|
-
update_feeds.py
14 14 for feed in Feed.objects.filter(is_defunct=False): 15 15 parsed_feed = feedparser.parse(feed.feed_url) 16 16 for entry in parsed_feed.entries: 17 title = entry.title.encode( parsed_feed.encoding, "xmlcharrefreplace")18 guid = entry.get("id", entry.link).encode( parsed_feed.encoding, "xmlcharrefreplace")19 link = entry.link.encode( parsed_feed.encoding, "xmlcharrefreplace")17 title = entry.title.encode("utf8", "xmlcharrefreplace") 18 guid = entry.get("id", entry.link).encode("utf8", "xmlcharrefreplace") 19 link = entry.link.encode("utf8", "xmlcharrefreplace") 20 20 21 21 if hasattr(entry, "summary"): 22 22 content = entry.summary … … 26 26 content = entry.description 27 27 else: 28 28 content = u"" 29 content = content.encode( parsed_feed.encoding, "xmlcharrefreplace")29 content = content.encode("utf8", "xmlcharrefreplace") 30 30 31 31 if entry.has_key('modified_parsed'): 32 32 date_modified = datetime.datetime.fromtimestamp(time.mktime(entry.modified_parsed))