Debian Codegraph @

recipes/winnipeg_free_press.recipe

raw
1 from calibre.web.feeds.news import BasicNewsRecipe
2
3
4 def classes(classes):
5 q = frozenset(classes.split(' '))
6 return dict(attrs={'class': lambda x: x and frozenset(x.split()).intersection(q)})
7
8
9 class WinnipegFreePress(BasicNewsRecipe):
10 title = 'Winnipeg Free Press'
11 __author__ = 'buyo'
12 description = 'News from Winnipeg, Manitoba, Canada'
13 oldest_article = 1
14 max_articles_per_feed = 15
15 category = 'News, Winnipeg, Canada'
16 no_stylesheets = True
17 encoding = 'UTF-8'
18 remove_javascript = True
19 use_embedded_content = False
20 language = 'en_CA'
21 extra_css = '''
22 .factbox { border: solid 2px; padding: 1rem }
23 '''
24
25 feeds = [
26 ('Breaking News', 'http://www.winnipegfreepress.com/rss?path=/breakingnews'),
27 ('Local News', 'http://www.winnipegfreepress.com/rss?path=/local'),
28 ('Breaking Business News', 'http://www.winnipegfreepress.com/rss?path=/business/finance'),
29 ('Business', 'http://www.winnipegfreepress.com/rss?path=/business'),
30 ('Editorials', 'http://www.winnipegfreepress.com/rss?path=/opinion/editorials'),
31 ('Views from the West', 'http://www.winnipegfreepress.com/rss?path=/opinion/westview'),
32 ('Life & Style', 'http://www.winnipegfreepress.com/rss?path=/life'),
33 ('Food & Drink', 'http://www.winnipegfreepress.com/rss?path=/life/food'),
34 ]
35
36 keep_only_tags = [classes('article-title topphoto storycontent')]
37 remove_tags = [dict(name='button')]