feed: fix RSS link handling
This commit is contained in:
parent
20c19a72bc
commit
85c418bd06
@ -82,11 +82,16 @@ class RSSEntry:
|
||||
else:
|
||||
self.summary = None
|
||||
|
||||
if len(node.getElementsByTagName("link")) > 0 and node.getElementsByTagName("link")[0].hasAttribute("href"):
|
||||
self.link = node.getElementsByTagName("link")[0].getAttribute("href")
|
||||
if len(node.getElementsByTagName("link")) > 0:
|
||||
self.link = node.getElementsByTagName("link")[0].firstChild.nodeValue
|
||||
else:
|
||||
self.link = None
|
||||
|
||||
if len(node.getElementsByTagName("enclosure")) > 0 and node.getElementsByTagName("enclosure")[0].hasAttribute("url"):
|
||||
self.enclosure = node.getElementsByTagName("enclosure")[0].getAttribute("url")
|
||||
else:
|
||||
self.enclosure = None
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
return "<RSSEntry title='%s' updated='%s'>" % (self.title, self.pubDate)
|
||||
|
Loading…
Reference in New Issue
Block a user