Add feedify, and use it in morss

This commit is contained in:
2013-09-25 12:36:21 +02:00
parent 9bc4417be3
commit da14242bcf
2 changed files with 74 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ import lxml.html.clean
import lxml.builder
import feeds
import feedify
import httplib
import urllib2
@@ -377,6 +378,8 @@ def Gather(url, cachePath, progress=False):
if xml[:5] == '<?xml' or con.info().type in MIMETYPE['xml']:
style = 'normal'
elif feedify.supported(url):
style = 'feedify'
elif con.info().type in MIMETYPE['html']:
style = 'html'
else:
@@ -389,6 +392,8 @@ def Gather(url, cachePath, progress=False):
if style == 'normal':
rss = feeds.parse(xml)
elif style == 'feedify':
xml = decodeHTML(xml)
rss = feedify.build(url, xml)
elif style == 'html':
match = lxml.html.fromstring(xml).xpath("//link[@rel='alternate'][@type='application/rss+xml' or @type='application/atom+xml']/@href")