]> git.sommitrealweird.co.uk Git - rss2maildir.git/blobdiff - rss2maildir.py
Fix for items that actually have no content.
[rss2maildir.git] / rss2maildir.py
index 84a9f0964408cd9f216d45be9b1921302f3312df..b77c6d7d11ef14c2878fcdcb379829f4f9f82f1e 100755 (executable)
@@ -562,7 +562,7 @@ class HTML2Text(HTMLParser):
         try:
             entity = unichr(int(name))
         except:
-            if entity[0] == 'x':
+            if name[0] == 'x':
                 try:
                     entity = unichr(int('0%s' %(name,), 16))
                 except:
@@ -683,7 +683,10 @@ def parse_and_deliver(maildir, url, statedir):
         if item.has_key("content"):
             content = item["content"][0]["value"]
         else:
-            content = item["summary"]
+            if item.has_key("description"):
+                content = item["description"]
+            else:
+                content = u''
 
         md5sum = md5.md5(content.encode("utf-8")).hexdigest()