From 8a5202efd5cc9ea72c57a53ebb945ffab6eb32ea Mon Sep 17 00:00:00 2001 From: pictuga Date: Mon, 21 Oct 2013 21:30:31 +0200 Subject: [PATCH] Improve facebook and feedburner workarounds --- morss.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/morss.py b/morss.py index 5a3a49c..debcf65 100644 --- a/morss.py +++ b/morss.py @@ -266,9 +266,8 @@ def Fill(item, cache, feedurl='/', fast=False): # feedburner feeds.NSMAP['feedburner'] = 'http://rssnamespace.org/feedburner/ext/1.0' - match = item.xval('feedburner:origLink') - if match: - item.link = match + if item.id: + item.link = item.id log(item.link) # feedsportal @@ -309,7 +308,7 @@ def Fill(item, cache, feedurl='/', fast=False): link = item.link # twitter - if urlparse.urlparse(item.link).netloc == 'twitter.com': + if urlparse.urlparse(feedurl).netloc == 'twitter.com': match = lxml.html.fromstring(item.content).xpath('//a/@data-expanded-url') if len(match): link = match[0]