Improve facebook and feedburner workarounds
parent
6bf7f60a3b
commit
8a5202efd5
7
morss.py
7
morss.py
|
@ -266,9 +266,8 @@ def Fill(item, cache, feedurl='/', fast=False):
|
||||||
|
|
||||||
# feedburner
|
# feedburner
|
||||||
feeds.NSMAP['feedburner'] = 'http://rssnamespace.org/feedburner/ext/1.0'
|
feeds.NSMAP['feedburner'] = 'http://rssnamespace.org/feedburner/ext/1.0'
|
||||||
match = item.xval('feedburner:origLink')
|
if item.id:
|
||||||
if match:
|
item.link = item.id
|
||||||
item.link = match
|
|
||||||
log(item.link)
|
log(item.link)
|
||||||
|
|
||||||
# feedsportal
|
# feedsportal
|
||||||
|
@ -309,7 +308,7 @@ def Fill(item, cache, feedurl='/', fast=False):
|
||||||
link = item.link
|
link = item.link
|
||||||
|
|
||||||
# twitter
|
# 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')
|
match = lxml.html.fromstring(item.content).xpath('//a/@data-expanded-url')
|
||||||
if len(match):
|
if len(match):
|
||||||
link = match[0]
|
link = match[0]
|
||||||
|
|
Loading…
Reference in New Issue