mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Merge branch 'master' of https://github.com/intromatyk/calibre
Update Dilbert and Antyweb
This commit is contained in:
commit
9db39821b4
@ -21,21 +21,9 @@ class AntywebRecipe(BasicNewsRecipe):
|
|||||||
simultaneous_downloads = 3
|
simultaneous_downloads = 3
|
||||||
|
|
||||||
keep_only_tags =[]
|
keep_only_tags =[]
|
||||||
keep_only_tags.append(dict(name = 'h1', attrs = { 'class' : 'mm-article-title'}))
|
keep_only_tags.append(dict(name = 'h1', attrs = { 'class' : 'entry-title '}))
|
||||||
keep_only_tags.append(dict(name = 'div', attrs = {'class' : 'mm-article-content'}))
|
keep_only_tags.append(dict(name = 'div', attrs = {'class' : 'news-content'}))
|
||||||
|
extra_css = '''body {font-family: verdana, arial, helvetica, geneva, sans-serif ;}'''
|
||||||
|
|
||||||
remove_tags =[]
|
|
||||||
remove_tags.append(dict(name = 'h2', attrs = {'class' : 'widgettitle'}))
|
|
||||||
remove_tags.append(dict(name = 'img', attrs = {'class' : 'alignleft'}))
|
|
||||||
remove_tags.append(dict(name = 'div', attrs = {'class' : 'float: right;margin-left:1em;margin-bottom: 0.5em;padding-bottom: 3px; width: 72px;'}))
|
|
||||||
remove_tags.append(dict(name = 'img', attrs = {'src' : 'http://antyweb.pl/wp-content/uploads/2011/09/HOSTERSI_testy_pasek600x30.gif'}))
|
|
||||||
remove_tags.append(dict(name = 'div', attrs = {'class' : 'podwpisowe'}))
|
|
||||||
|
|
||||||
|
|
||||||
extra_css = '''
|
|
||||||
body {font-family: verdana, arial, helvetica, geneva, sans-serif ;}
|
|
||||||
'''
|
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'Artykuly', u'feed://feeds.feedburner.com/Antyweb?format=xml'),
|
(u'Artykuly', u'feed://feeds.feedburner.com/Antyweb?format=xml'),
|
||||||
|
@ -6,6 +6,7 @@ DrMerry added cover Image 2011-11-12
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||||
|
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
||||||
import re
|
import re
|
||||||
|
|
||||||
class DilbertBig(BasicNewsRecipe):
|
class DilbertBig(BasicNewsRecipe):
|
||||||
@ -16,7 +17,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 +31,14 @@ 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