Debian Codegraph @

recipes/padreydecano.recipe

raw
1 #!/usr/bin/env python
2 ##
3 # Title: Padreydecano.com News, Sports, and Blog
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__ = '2016, Carlos Alves <[email protected]>'
14
15 '''
16 padreydecano.com
17 '''
18
19 from calibre.web.feeds.news import BasicNewsRecipe
20
21
22 class General(BasicNewsRecipe):
23 title = 'Padre y Decano'
24 __author__ = 'Carlos Alves'
25 description = 'El sitio del pueblo'
26 tags = 'soccer, futbol, Peñarol'
27 language = 'es_UY'
28 timefmt = '[%a, %d %b, %Y]'
29 use_embedded_content = False
30 recursion = 5
31 encoding = None
32 remove_javascript = True
33 no_stylesheets = True
34
35 oldest_article = 10
36 max_articles_per_feed = 100
37 keep_only_tags = [dict(name='h1', attrs={'class': 'entry-title'}), dict(name='div', attrs={'class': 'entry-content clearfix'})]
38
39 remove_tags = [
40 dict(name='div', attrs={'class': ['br', 'hr', 'titlebar', 'navigation']}),
41 dict(name='dl', attrs={'class': 'gallery-item'}),
42 dict(name=['object', 'link']),
43 ]
44
45 extra_css = '''
46 h1{font-family: Georgia,"Times New Roman",Times,serif}
47 h3{font-family: Georgia,"Times New Roman",Times,serif}
48 h2{font-family: Georgia,"Times New Roman",Times,serif}
49 p{font-family: Verdana,Arial,Helvetica,sans-serif}
50 body{font-family: Verdana,Arial,Helvetica,sans-serif}
51 img{margin-bottom: 0.4em; display:block;}
52 '''
53
54 feeds = [('Padre y Decano | Club Atlético Peñarol', 'http://www.padreydecano.com/cms/feed/')]
55
56 def get_cover_url(self):
57 return None
58
59 def preprocess_html(self, soup):
60 for item in soup.findAll(style=True):
61 del item['style']
62 return soup