mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Update Smithsonian Magazine
This commit is contained in:
parent
1bc7ddfdbf
commit
01acc48b14
@ -48,10 +48,14 @@ class Smithsonian(BasicNewsRecipe):
|
||||
link=post.find('a',href=True)
|
||||
url=link['href']+'?c=y&story=fullstory'
|
||||
if subsection is not None:
|
||||
subsection_title = self.tag_to_string(subsection)
|
||||
subsection_title = self.tag_to_string(subsection).strip()
|
||||
prefix = (subsection_title+': ')
|
||||
description=self.tag_to_string(post('p', limit=2)[1]).strip()
|
||||
else:
|
||||
if post.find('img') is not None:
|
||||
subsection_title = self.tag_to_string(post.findPrevious('div', attrs={'class':'departments plainModule'}).find('p', attrs={'class':'article-cat'})).strip()
|
||||
prefix = (subsection_title+': ')
|
||||
|
||||
description=self.tag_to_string(post.find('p')).strip()
|
||||
desc=re.sub('\sBy\s.*', '', description, re.DOTALL)
|
||||
author=re.sub('.*By\s', '', description, re.DOTALL)
|
||||
@ -64,4 +68,3 @@ class Smithsonian(BasicNewsRecipe):
|
||||
feeds[section_title] += articles
|
||||
ans = [(key, val) for key, val in feeds.iteritems()]
|
||||
return ans
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user