Debian Codegraph @

recipes/cm_journal.recipe

raw
1 from calibre.web.feeds.news import BasicNewsRecipe
2
3
4 class CMJornal_pt(BasicNewsRecipe):
5 title = 'Correio da Manha - Portugal'
6 __author__ = 'jmst'
7 description = 'As noticias de Portugal e do Mundo'
8 publisher = 'Cofina Media'
9 category = ''
10 oldest_article = 1
11 no_stylesheets = True
12 encoding = 'utf-8'
13 use_embedded_content = False
14 language = 'pt'
15 extra_css = (
16 ' .publish{font-style: italic; line-height: 1.2em; border-bottom: 1px dotted; padding: 5px 0} .entity{line-height: 1.2em} .overview{line-height:1.2em} ' # noqa: E501
17 )
18
19 conversion_options = {'comment': description, 'tags': category, 'publisher': publisher, 'language': language}
20
21 keep_only_tags = [dict(name=['h2', 'h1']), dict(name='div', attrs={'class': ['news']})]
22
23 remove_tags = [dict(name=['object', 'embed', 'iframe']), dict(name='a', attrs={'href': ['#']})]
24
25 feeds = [
26 ('Actualidade', 'http://www.cmjornal.xl.pt/rss/rss.aspx?channelID=00000009-0000-0000-0000-000000000009'),
27 ('Portugal', 'http://www.cmjornal.xl.pt/rss/rss.aspx?channelID=00000010-0000-0000-0000-000000000010'),
28 ('Economia', 'http://www.cmjornal.xl.pt/rss/rss.aspx?channelID=00000011-0000-0000-0000-000000000011'),
29 ('Mundo', 'http://www.cmjornal.xl.pt/rss/rss.aspx?channelID=00000091-0000-0000-0000-000000000091'),
30 ('Desporto', 'http://www.cmjornal.xl.pt/rss/rss.aspx?channelID=00000012-0000-0000-0000-000000000012'),
31 ('TV & Media', 'http://www.cmjornal.xl.pt/rss/rss.aspx?channelID=00000092-0000-0000-0000-000000000092'),
32 ]
33
34 def print_version(self, url):
35 return url.replace('noticia.aspx', 'Imprimir.aspx')