mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
update Dilbert recipe
This commit is contained in:
parent
9a6073fcfb
commit
f555ab5279
@ -16,7 +16,7 @@ class DilbertBig(BasicNewsRecipe):
|
|||||||
oldest_article = 15
|
oldest_article = 15
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
use_embedded_content = True
|
use_embedded_content = False
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
publisher = 'UNITED FEATURE SYNDICATE, INC.'
|
publisher = 'UNITED FEATURE SYNDICATE, INC.'
|
||||||
category = 'comic'
|
category = 'comic'
|
||||||
@ -30,25 +30,13 @@ class DilbertBig(BasicNewsRecipe):
|
|||||||
,'publisher' : publisher
|
,'publisher' : publisher
|
||||||
}
|
}
|
||||||
|
|
||||||
feeds = [(u'Dilbert', u'http://feed.dilbert.com/dilbert/daily_strip' )]
|
feeds = [(u'Dilbert', u'http://feed.dilbert.com/dilbert/daily_strip')]
|
||||||
|
|
||||||
def get_article_url(self, article):
|
|
||||||
return article.get('feedburner_origlink', None)
|
|
||||||
|
|
||||||
preprocess_regexps = [
|
preprocess_regexps = [
|
||||||
(re.compile('strip\..*\.gif', re.DOTALL|re.IGNORECASE), lambda match: 'strip.zoom.gif')
|
(re.compile('strip\..*\.gif', re.DOTALL|re.IGNORECASE), lambda match: 'strip.zoom.gif')
|
||||||
]
|
]
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for tag in soup.findAll(name='a'):
|
for tag in soup.findAll(name='input'):
|
||||||
if tag['href'].find('http://feedads') >= 0:
|
image = BeautifulSoup('<img src=' + tag['value'] + '></img>')
|
||||||
tag.extract()
|
return image
|
||||||
return soup
|
|
||||||
|
|
||||||
extra_css = '''
|
|
||||||
h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;}
|
|
||||||
h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;}
|
|
||||||
img {max-width:100%; min-width:100%;}
|
|
||||||
p{font-family:Arial,Helvetica,sans-serif;font-size:small;}
|
|
||||||
body{font-family:Helvetica,Arial,sans-serif;font-size:small;}
|
|
||||||
'''
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user