Debian Codegraph @

recipes/taz_rss.recipe

raw
1 __license__ = 'GPL v3'
2 __copyright__ = '2013, Alexander Schremmer <[email protected]>, Robert Riemann <[email protected]>'
3
4 import re
5
6 from calibre.web.feeds.news import BasicNewsRecipe
7
8
9 class TazRSSRecipe(BasicNewsRecipe):
10 title = 'Taz - die Tageszeitung'
11 description = 'Taz.de - die tageszeitung (Anpassung von Robert)'
12 __author__ = 'Alexander Schremmer, Robert Riemann'
13 language = 'de'
14 lang = 'de-DE'
15 category = 'news, Germany'
16 timefmt = ' [%a, %d %b %Y]'
17 publication_type = 'newspaper'
18 remove_empty_feeds = True
19 use_embedded_content = False
20 oldest_article = 7
21 max_articles_per_feed = 100
22 publisher = 'taz Entwicklungs GmbH & Co. Medien KG'
23 # masthead_url = u'http://galeria-autonomica.de/wp-content/uploads/a_taz-logo.gif'
24 masthead_url = 'http://upload.wikimedia.org/wikipedia/de/thumb/1/15/Die-Tageszeitung-Logo.svg/500px-Die-Tageszeitung-Logo.svg.png'
25
26 conversion_options = {
27 'publisher': publisher,
28 'language': lang,
29 }
30 feeds = [
31 ('Schlagzeilen', 'http://www.taz.de/!p3270;rss/'),
32 ('Politik', 'http://www.taz.de/Politik/!p2;rss/'),
33 ('Zukunft', 'http://www.taz.de/Zukunft/!p4;rss/'),
34 ('Netz', 'http://www.taz.de/Netz/!p5;rss/'),
35 ('Debatte', 'http://www.taz.de/Debatte/!p9;rss/'),
36 ('Leben', 'http://www.taz.de/Leben/!p10;rss/'),
37 ('Sport', 'http://www.taz.de/Sport/!p12;rss/'),
38 ('Wahrheit', 'http://www.taz.de/Wahrheit/!p13;rss/'),
39 ('Berlin', 'http://www.taz.de/Berlin/!p14;rss/'),
40 ('Nord', 'http://www.taz.de/Nord/!p11;rss/'),
41 ]
42 # omit articles already linked in Schlagzeilen feed
43 ignore_duplicate_articles = {'title', 'url'}
44
45 # use the cover presented on the homepage
46 cover_url = 'http://www.taz.de/digitaz/.s1jpeg320'
47
48 no_stylesheets = True # default value is False, but True makes process much faster
49 keep_only_tags = [dict(name=['div'], attrs={'class': re.compile(r'.*\bsect_article\b.*')})]
50 remove_tags = [
51 dict(name=['div'], attrs={'class': 'sectfoot'}),
52 # remove: taz paywall
53 dict(name=['div'], attrs={'id': 'tzi_paywall'}),
54 ]
55
56
57 # with article pictures on Kindle super-slow
58 # def populate_article_metadata(self, article, soup, first):
59 # if first and hasattr(self, 'add_toc_thumbnail'):
60 # picdiv = soup.find('img')
61 # if picdiv is not None:
62 # self.add_toc_thumbnail(article,picdiv['src'])