mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Fix #1088067 (Updated recipe for Harpers)
This commit is contained in:
parent
613a0eb834
commit
a1a50c3415
@ -1,5 +1,5 @@
|
|||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008-2010, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2008-2012, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
harpers.org
|
harpers.org
|
||||||
'''
|
'''
|
||||||
@ -16,7 +16,7 @@ class Harpers(BasicNewsRecipe):
|
|||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
auto_cleanup = True
|
masthead_url = 'http://harpers.org/wp-content/themes/harpers/images/pheader.gif'
|
||||||
|
|
||||||
conversion_options = {
|
conversion_options = {
|
||||||
'comment' : description
|
'comment' : description
|
||||||
@ -32,27 +32,9 @@ class Harpers(BasicNewsRecipe):
|
|||||||
.caption{font-family:Verdana,sans-serif;font-size:x-small;color:#666666;}
|
.caption{font-family:Verdana,sans-serif;font-size:x-small;color:#666666;}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
#keep_only_tags = [ dict(name='div', attrs={'id':'cached'}) ]
|
keep_only_tags = [ dict(name='div', attrs={'class':['postdetailFull', 'articlePost']}) ]
|
||||||
#remove_tags = [
|
remove_tags = [dict(name=['link','object','embed','meta','base'])]
|
||||||
#dict(name='table', attrs={'class':['rcnt','rcnt topline']})
|
remove_attributes = ['width','height']
|
||||||
#,dict(name=['link','object','embed','meta','base'])
|
|
||||||
#]
|
|
||||||
#remove_attributes = ['width','height']
|
|
||||||
|
|
||||||
feeds = [(u"Harper's Magazine", u'http://harpers.org/feed/')]
|
feeds = [(u"Harper's Magazine", u'http://harpers.org/feed/')]
|
||||||
|
|
||||||
def get_cover_url(self):
|
|
||||||
cover_url = None
|
|
||||||
index = 'http://harpers.org/'
|
|
||||||
soup = self.index_to_soup(index)
|
|
||||||
link_item = soup.find(name = 'img',attrs= {'class':"cover"})
|
|
||||||
if link_item:
|
|
||||||
cover_url = 'http://harpers.org' + link_item['src']
|
|
||||||
return cover_url
|
|
||||||
|
|
||||||
#def preprocess_html(self, soup):
|
|
||||||
#for item in soup.findAll(style=True):
|
|
||||||
#del item['style']
|
|
||||||
#for item in soup.findAll(xmlns=True):
|
|
||||||
#del item['xmlns']
|
|
||||||
#return soup
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user