Debian Codegraph @

recipes/juventudrebelde.recipe

raw
1 __license__ = 'GPL v3'
2 __copyright__ = '2011, Oscar Megia Lopez'
3 '''
4 juventudrebelde.cu
5 '''
6 import re
7
8 from calibre.web.feeds.recipes import BasicNewsRecipe
9
10
11 class JuventudRebelde(BasicNewsRecipe):
12 title = 'Juventud Rebelde'
13 __author__ = 'Oscar Megia Lopez'
14 description = 'Periodico cubano'
15 oldest_article = 30
16 max_articles_per_feed = 100
17 no_stylesheets = True
18 use_embedded_content = False
19 encoding = 'utf8'
20 publisher = 'Juventud Rebelde'
21 category = 'Noticias'
22 language = 'es'
23 publication_type = 'Periodico'
24 extra_css = ' body{ font-family: Verdana,Helvetica,Arial,sans-serif } .title{font-weight: bold} .read{display: block; padding: 0; border: 1px solid; width: 40%; font-size: small} .story-feature h2{text-align: center; text-transform: uppercase} ' # noqa: E501
25 preprocess_regexps = [(re.compile(r'<!--.*?-->', re.DOTALL), lambda m: '')]
26 conversion_options = {'comments': description, 'tags': category, 'language': language, 'publisher': publisher, 'linearize_tables': True}
27
28 keep_only_tags = [dict(name='div', attrs={'class': ['title']}), dict(attrs={'class': ['read']}), dict(attrs={'class': ['author']})]
29
30 remove_tags = [
31 dict(name='div', attrs={'class': ['share']}),
32 ]
33
34 remove_attributes = ['width', 'height']
35
36 feeds = [
37 ('Generales', 'http://www.juventudrebelde.cu/get/rss/grupo/generales/'),
38 ('Internacionales', 'http://www.psychologytoday.com/blog/romance-redux/feed'),
39 ('Ciencia y Tecnica', 'http://www.juventudrebelde.cu/get/rss/noticias/ciencia-tecnica/'),
40 ('Opini\xf3n', 'http://www.juventudrebelde.cu/get/rss/noticias/opinion/'),
41 ('Cuba', 'http://www.juventudrebelde.cu/get/rss/noticias/cuba/'),
42 ('Cultura', 'http://www.juventudrebelde.cu/get/rss/noticias/cultura/'),
43 ('Deportes', 'http://www.juventudrebelde.cu/get/rss/noticias/deportes'),
44 ]