Merge
This commit is contained in:
commit
dc90b729d4
1 changed files with 11 additions and 11 deletions
|
@ -247,7 +247,17 @@ def find_possible_feeds(origin):
|
|||
})
|
||||
|
||||
elif content_type == 'text/html':
|
||||
# if text/html, then parse and look for rel="alternate"
|
||||
# if text/html, then parse and look for h-entries
|
||||
hfeed = mf2util.interpret_feed(
|
||||
mf2py.Parser(doc=resp.text).to_dict(), origin)
|
||||
if hfeed.get('entries'):
|
||||
feeds.append({
|
||||
'origin': origin,
|
||||
'feed': origin,
|
||||
'type': 'html',
|
||||
})
|
||||
|
||||
# then look for link rel="alternate"
|
||||
soup = bs4.BeautifulSoup(resp.text)
|
||||
for link in soup.find_all('link', {'rel': 'alternate'}):
|
||||
if link.get('type') in xml_feed_types:
|
||||
|
@ -257,14 +267,4 @@ def find_possible_feeds(origin):
|
|||
'feed': feed_url,
|
||||
'type': 'xml',
|
||||
})
|
||||
|
||||
hfeed = mf2util.interpret_feed(
|
||||
mf2py.Parser(doc=resp.text).to_dict(), origin)
|
||||
if hfeed.get('entries'):
|
||||
feeds.append({
|
||||
'origin': origin,
|
||||
'feed': origin,
|
||||
'type': 'html',
|
||||
})
|
||||
|
||||
return feeds
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue