]> projects.mako.cc - iron-blogger/blobdiff - scan-feeds.py
scan-feeds: Warn if we can't find someone's entries.
[iron-blogger] / scan-feeds.py
index 998a1cc5e4c2dc722e8a28d970ec200ed8dcd334..9801762b242691d2a66e56216a2e97d01624a9a4 100755 (executable)
@@ -2,6 +2,7 @@
 import yaml
 import feedparser
 import datetime
+import sys
 from dateutil.parser import parse
 import dateutil.tz as tz
 
@@ -21,18 +22,12 @@ 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 None
+    return post.link
 
 def parse_feeds(weeks, uri):
     feed = feedparser.parse(uri)
+    if not feed.entries:
+        print >>sys.stderr, "WARN: no entries for ", uri
     for post in feed.entries:
         date = parse_published(get_date(post))
 

Benjamin Mako Hill || Want to submit a patch?