Debian Codegraph @

recipes/diario_el_pueblo.recipe

raw
1 #!/usr/bin/env python
2 ##
3 # Title: Diario El Pueblo News and Sports Calibre Recipe
4 # Contact: Carlos Alves - <[email protected]>
5 ##
6 # License: GNU General Public License v3 - http://www.gnu.org/copyleft/gpl.html
7 # Copyright: Carlos Alves - <[email protected]>
8 ##
9 # Written: September 2013
10 # Last Edited: 2018-02-13
11 ##
12 __license__ = 'GPL v3'
13 __author__ = '2013, Carlos Alves <[email protected]>'
14 '''
15 diarioelpueblo.com.uy
16 '''
17
18 from calibre.web.feeds.news import BasicNewsRecipe
19
20
21 class General(BasicNewsRecipe):
22 title = 'Diario El Pueblo'
23 __author__ = 'Carlos Alves'
24 description = 'Noticias de Salto - Uruguay'
25 tags = 'news, sports'
26 language = 'es_UY'
27 timefmt = '[%a, %d %b, %Y]'
28 use_embedded_content = False
29 recursion = 5
30 encoding = 'utf8'
31 remove_javascript = True
32 no_stylesheets = True
33
34 oldest_article = 2
35 max_articles_per_feed = 100
36 keep_only_tags = [dict(name='div', attrs={'class': 'post-alt blog'})]
37
38 remove_tags = [
39 dict(name='div', attrs={'class': ['hr', 'titlebar', 'volver-arriba-right', 'navigation']}),
40 dict(
41 name='div',
42 attrs={
43 'id': 'comment suckerfish crp_related'.split(),
44 },
45 ),
46 dict(name='h3', attrs={'class': ['post_date']}),
47 dict(name=['object', 'link']),
48 ]
49
50 extra_css = '''
51 h1{font-family: Georgia,"Times New Roman",Times,serif}
52 h3{font-family: Georgia,"Times New Roman",Times,serif}
53 h2{font-family: Georgia,"Times New Roman",Times,serif}
54 p{font-family: Verdana,Arial,Helvetica,sans-serif}
55 body{font-family: Verdana,Arial,Helvetica,sans-serif}
56 img{margin-bottom: 0.4em; display:block;}
57 '''
58
59 feeds = [('Articulos', 'http://www.diarioelpueblo.com.uy/feed')]
60
61 def get_cover_url(self):
62 return None
63
64 def preprocess_html(self, soup):
65 for item in soup.findAll(style=True):
66 del item['style']
67 return soup