Commit 2373f68c by murtaugh

use urlopen with feedparser, attempting to address odd behaviour with feedparser…

use urlopen with feedparser, attempting to address odd behaviour with feedparser returning feeds with no entries on otherwise valid feeds
parent 6a26e831
......@@ -322,7 +322,8 @@ class SiteWeb (object):
def process_feed(self, cachedir, limit=None, phpuploader=None, user=None, force=False, pretend=False):
print ("[process_feed]: feed_url {0}".format(self.feed_url), file=sys.stderr)
feed = feedparser.parse(self.feed_url)
# adding urlopen as I otherwise encountered malformed XML issues (feedparser fail silently)
feed = feedparser.parse(urlopen(self.feed_url))
# ensure in reverse chronological order (probably redundant but important for the processing)
print ("[process_feed]: {0} items".format(len(feed.entries)), file=sys.stderr)
feed.entries.sort(key=lambda x: PageWeb.get_item_date(x), reverse=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment