]> projects.mako.cc - iron-blogger/commitdiff
scan-feeds: Support more timestamp formats
authorNelson Elhage <nelhage@mit.edu>
Mon, 15 Feb 2010 20:30:33 +0000 (15:30 -0500)
committerNelson Elhage <nelhage@mit.edu>
Mon, 15 Feb 2010 20:30:33 +0000 (15:30 -0500)
scan-feeds.py

index 7e27b8c2a5c8e0e9012b744a19f2950747e7e9ff..bf60aefbaeec5a3b4e6b02bda4bffe89ce2f99cc 100755 (executable)
@@ -21,9 +21,9 @@ def parse_published(pub):
     return parse(pub).astimezone(tz.tzlocal()).replace(tzinfo=None)
 
 def get_date(post):
-    if 'published' in post:
-        return post.published
-    return post.updated
+    for k in ('published', 'created', 'updated'):
+        if k in post:
+            return post[k]
 
 def get_link(post):
     return post.link

Benjamin Mako Hill || Want to submit a patch?