X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=XMLParse2.py;h=488a3443072c5aca543047bdd65f067b188bc2d7;hb=refs%2Fheads%2Fmaster;hp=978b41829b10971a592fc4bc45be45ddc72466cd;hpb=a4faa68ff5b4b2fd83a63aa16ab8572f8d9d7cf3;p=planet-ucc.git diff --git a/XMLParse2.py b/XMLParse2.py index 978b418..488a344 100644 --- a/XMLParse2.py +++ b/XMLParse2.py @@ -106,7 +106,11 @@ class XMLParse: except: blogItem.itemDate = 0 else: blogItem.itemDate = 0 - if entry.has_key('description'): + if entry.has_key('content'): + # get the contents of the first item with a text/html type + # no feeds without a text/html type have been encountered in the wild, but who knows + blogItem.contents = [content['value'] for content in entry['content'] if content['type'] == 'text/html'][0] + elif entry.has_key('description'): blogItem.contents = entry['description'] else: blogItem.contents = '(entry could not be retrieved)'