mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Science News
This commit is contained in:
parent
a8d9d760ff
commit
cd1765b935
@ -50,6 +50,10 @@ class ScienceNewsIssue(BasicNewsRecipe):
|
|||||||
dict(name='ul', attrs={'id':'toc'})
|
dict(name='ul', attrs={'id':'toc'})
|
||||||
]
|
]
|
||||||
|
|
||||||
|
remove_tags= [ dict(name='a', attrs={'class':'enlarge print-no'}),
|
||||||
|
dict(name='a', attrs={'rel':'shadowbox'})
|
||||||
|
]
|
||||||
|
|
||||||
feeds = [(u"Science News Current Issues", u'http://www.sciencenews.org/view/feed/type/edition/name/issues.rss')]
|
feeds = [(u"Science News Current Issues", u'http://www.sciencenews.org/view/feed/type/edition/name/issues.rss')]
|
||||||
|
|
||||||
match_regexps = [
|
match_regexps = [
|
||||||
@ -57,6 +61,12 @@ class ScienceNewsIssue(BasicNewsRecipe):
|
|||||||
r'www.sciencenews.org/view/generic/id'
|
r'www.sciencenews.org/view/generic/id'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def image_url_processor(self, baseurl, url):
|
||||||
|
x = url.split('/')
|
||||||
|
if x[4] == u'scale':
|
||||||
|
url = u'http://www.sciencenews.org/view/download/id/' + x[6] + u'/name/' + x[-1]
|
||||||
|
return url
|
||||||
|
|
||||||
def get_cover_url(self):
|
def get_cover_url(self):
|
||||||
cover_url = None
|
cover_url = None
|
||||||
index = 'http://www.sciencenews.org/view/home'
|
index = 'http://www.sciencenews.org/view/home'
|
||||||
@ -64,7 +74,6 @@ class ScienceNewsIssue(BasicNewsRecipe):
|
|||||||
link_item = soup.find(name = 'img',alt = "issue")
|
link_item = soup.find(name = 'img',alt = "issue")
|
||||||
if link_item:
|
if link_item:
|
||||||
cover_url = 'http://www.sciencenews.org' + link_item['src'] + '.jpg'
|
cover_url = 'http://www.sciencenews.org' + link_item['src'] + '.jpg'
|
||||||
|
|
||||||
return cover_url
|
return cover_url
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user