X-Git-Url: https://projects.mako.cc/source/iron-blogger/blobdiff_plain/364ecc7623bd4a3940ca1876d639777471df0de4..3580088d8cbe24e93875479786ddcc174dc539ba:/report.py diff --git a/report.py b/report.py index 2c9a97e..e782c49 100644 --- a/report.py +++ b/report.py @@ -20,9 +20,15 @@ def get_date(post): return post.updated def get_link(post): + if 'links' in post: + links = dict((l.rel, l) for l in post.links if 'html' in l.type) + if 'self' in links: + return links['self'].href + elif 'alternate' in links: + return links['alternate'].href if 'href' in post: return post.href - return post.links[0]['href'] + return None def parse_feeds(weeks, uri): feed = feedparser.parse(uri)