Debian Codegraph @

recipes/abc.recipe

raw
1 import re
2
3 from calibre.web.feeds.news import BasicNewsRecipe
4
5
6 class ABCRecipe(BasicNewsRecipe):
7 title = 'ABC Linuxu'
8 oldest_article = 5
9 max_articles_per_feed = 3 # 5
10 __author__ = 'Funthomas'
11 language = 'cs'
12
13 feeds = [
14 # (u'Blogy', u'http://www.abclinuxu.cz/auto/blogDigest.rss'),
15 ('Články', 'http://www.abclinuxu.cz/auto/abc.rss'),
16 ('Zprávičky', 'http://www.abclinuxu.cz/auto/zpravicky.rss'),
17 ]
18
19 remove_javascript = True
20 no_stylesheets = True
21 remove_attributes = ['width', 'height']
22
23 remove_tags_before = dict(name='h1')
24 remove_tags = [dict(attrs={'class': ['meta-vypis', 'page_tools', 'cl_perex']}), dict(attrs={'class': ['cl_nadpis-link', 'komix-nav']})]
25
26 remove_tags_after = [
27 dict(name='div', attrs={'class': ['cl_perex', 'komix-nav']}),
28 dict(attrs={'class': ['meta-vypis', 'page_tools']}),
29 dict(name='', attrs={'': ''}),
30 ]
31
32 preprocess_regexps = [(re.compile(r'</div>.*<p class="perex">', re.DOTALL), lambda match: '</div><p class="perex">')]
33
34 def print_version(self, url):
35 return url + '?varianta=print&noDiz'
36
37 extra_css = '''
38 h1 {font-size:130%; font-weight:bold}
39 h3 {font-size:111%; font-weight:bold}
40 '''