Add support for twitter
Grabs "feed" from the html page, clips tweet and article together.
This commit is contained in:
8
morss.py
8
morss.py
@@ -304,6 +304,14 @@ def Fill(item, cache, feedurl='/', fast=False, clip=False):
|
||||
|
||||
link = item.link
|
||||
|
||||
# twitter
|
||||
if urlparse.urlparse(item.link).netloc == 'twitter.com':
|
||||
match = lxml.html.fromstring(item.content).xpath('//a/@data-expanded-url')
|
||||
if len(match):
|
||||
link = match[0]
|
||||
clip = True
|
||||
log(link)
|
||||
|
||||
# check cache and previous errors
|
||||
if link in cache:
|
||||
content = cache.get(link)
|
||||
|
Reference in New Issue
Block a user