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