Update for wordpress.com blogs
authorSelena Deckelmann <selena@endpoint.com>
Tue, 2 Jun 2009 20:42:29 +0000 (13:42 -0700)
committerSelena Deckelmann <selena@endpoint.com>
Tue, 2 Jun 2009 20:42:29 +0000 (13:42 -0700)
aggregator.py

index 20de7f7590ecf6bc2540f83d9a85aeae18acdb6e..d1f03daf492c86c3e8df9759a91bac075d0d3a62 100755 (executable)
@@ -72,11 +72,13 @@ class Aggregator:
                        # much shorter. Other blog software store what we want in the summary
                        # attribute. So let's just try one after another until we hit something.
                        try:
-                               txt = entry.content[0].value
+                               # Fix for broken wordpress.com blogs
+                               if entry.content[0].has_key('base'):
+                                       txt = entry.content[0].value
+                               else:
+                                       txt = entry.summary
                        except:
                                txt = ''
-                       if txt == '' and entry.has_key('summary'):
-                               txt = entry.summary
                        if txt == '':
                                # Not a critical error, we just ignore empty posts
                                print "Failed to get text for entry at %s" % entry.link