Debian Codegraph @

recipes/abc_es.recipe

raw
1 #!/usr/bin/env python
2 # vim:fileencoding=utf-8
3 __license__ = 'GPL v3'
4 __author__ = 'Ricardo Jurado'
5 __copyright__ = 'Ricardo Jurado'
6 __version__ = 'v0.4'
7 __date__ = '11 February 2011'
8
9 '''
10 http://www.abc.es/
11 '''
12
13 from calibre.web.feeds.news import BasicNewsRecipe
14
15
16 class AdvancedUserRecipe1296604369(BasicNewsRecipe):
17 title = 'ABC.es'
18 masthead_url = 'http://www.abc.es/img/logo-abc.gif'
19 cover_url = 'http://www.abc.es/img/logo-abc.gif'
20 publisher = 'Grupo VOCENTO'
21
22 __author__ = 'Ricardo Jurado'
23 description = 'Noticias de Spain y el mundo'
24 category = 'News,Spain,National,International,Economy'
25 oldest_article = 2
26 max_articles_per_feed = 25
27
28 no_stylesheets = True
29 use_embedded_content = False
30 encoding = 'ISO-8859-1'
31 auto_cleanup = True
32 remove_javascript = True
33 language = 'es'
34
35 recipe_specific_options = {
36 'days': {
37 'short': 'Oldest article to download from this news source. In days ',
38 'long': 'For example, 0.5, gives you articles from the past 12 hours',
39 'default': str(oldest_article),
40 }
41 }
42
43 def __init__(self, *args, **kwargs):
44 BasicNewsRecipe.__init__(self, *args, **kwargs)
45 d = self.recipe_specific_options.get('days')
46 if d and isinstance(d, str):
47 self.oldest_article = float(d)
48
49 extra_css = '''
50 p{text-align: justify; font-size: 100%}
51 body{ text-align: left; font-size:100% }
52 h3{font-family: sans-serif; font-size:120%; font-weight:bold; text-align: justify; }
53 h2{font-family: sans-serif; font-size:100%; font-weight:bold; text-align: justify; }
54 h1{font-family: sans-serif; font-size:150%; font-weight:bold; text-align: justify; }
55 '''
56
57 feeds = [
58 ('PORTADA', 'http://www.abc.es/rss/feeds/abcPortada.xml'),
59 ('ULTIMAS', 'http://www.abc.es/rss/feeds/abc_ultima.xml'),
60 ('NACIONAL', 'http://www.abc.es/rss/feeds/abc_EspanaEspana.xml'),
61 ('INTERNACIONAL', 'http://www.abc.es/rss/feeds/abc_Internacional.xml'),
62 ('OPINION', 'http://www.abc.es/rss/feeds/abc_opinioncompleto.xml'),
63 ('BLOGS ABC', 'http://www.abc.es/rss/feeds/blogs-abc.xml'),
64 ('ECONOMIA', 'http://www.abc.es/rss/feeds/abc_Economia.xml'),
65 ('CIENCIA Y TECNOLOGIA', 'http://www.abc.es/rss/feeds/abc_Ciencia_Tecnologia.xml'),
66 ('CULTURA', 'http://www.abc.es/rss/feeds/abc_Cultura.xml'),
67 ('LIBROS', 'http://www.abc.es/rss/feeds/abc_Libros.xml'),
68 ('MEDIOS Y REDES', 'http://www.abc.es/rss/feeds/ABC_Medios_Redes.xml'),
69 ('EVASION', 'http://www.abc.es/rss/feeds/abc_evasion.xml'),
70 ('ESPECTACULOS', 'http://www.abc.es/rss/feeds/abc_Espectaculos.xml'),
71 ('GENTE', 'http://www.abc.es/rss/feeds/abc_Gente.xml'),
72 ('DEPORTES', 'http://www.abc.es/rss/feeds/abc_Deportes.xml'),
73 ]