From 7c3aaf586484db222df6a5c8dcaac09321a0d8af Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 29 Jul 2011 15:59:14 -0600 Subject: [PATCH] El Tiempo, El Colombiano and Portafolio Colombia by Cavalencia --- recipes/el_colombiano.recipe | 58 +++++++++++++++++++++++++++++++ recipes/el_tiempo.recipe | 53 ++++++++++++++++++++++++++++ recipes/portafolio.recipe | 36 +++++++++++++++++++ src/calibre/utils/localization.py | 1 + 4 files changed, 148 insertions(+) create mode 100644 recipes/el_colombiano.recipe create mode 100644 recipes/el_tiempo.recipe create mode 100644 recipes/portafolio.recipe diff --git a/recipes/el_colombiano.recipe b/recipes/el_colombiano.recipe new file mode 100644 index 0000000000..492229dc4f --- /dev/null +++ b/recipes/el_colombiano.recipe @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- + +from calibre.web.feeds.news import BasicNewsRecipe + + + +class AdvancedUserRecipe1311790237(BasicNewsRecipe): + title = u'Periódico El Colombiano' + language = 'es_CO' + __author__ = 'BIGO-CAVA' + cover_url = 'http://www.elcolombiano.com/images/logoElColombiano348x46.gif' + remove_tags_before = dict(id='contenidoArt') + remove_tags_after = dict(id='enviaTips') + remove_tags_after = dict(id='zonaPata') + oldest_article = 1 + max_articles_per_feed = 100 + remove_javascript = True + no_stylesheets = True + use_embedded_content = False + remove_empty_feeds = True + masthead_url = 'http://www.elcolombiano.com/images/logoElColombiano348x46.gif' + publication_type = 'newspaper' + + extra_css = """ + p{text-align: justify; font-size: 100%} + body{ text-align: left; font-size:100% } + h1{font-family: sans-serif; font-size:150%; font-weight:bold; text-align: justify; } + h3{font-family: sans-serif; font-size:100%; font-style: italic; text-align: justify; } + """ + + + feeds = [(u'Portada', u'http://www.elcolombiano.com/rss/portada.xml'), + (u'Antioquia', u'http://www.elcolombiano.com/rss/Antioquia.xml'), + (u'Colombia', u'http://www.elcolombiano.com/rss/Colombia.xml'), + (u'Economia', u'http://www.elcolombiano.com/rss/Economia.xml'), + (u'Internacional', u'http://www.elcolombiano.com/rss/Internacional.xml'), + (u'Politica', u'http://www.elcolombiano.com/rss/Politica.xml'), + (u'Cultura', u'http://www.elcolombiano.com/rss/Cultura.xml'), + (u'Entretenimiento', u'http://www.elcolombiano.com/rss/Farandula.xml'), + (u'Tecnologia', u'http://www.elcolombiano.com/rss/Tecnologia.xml'), + (u'Television', u'http://www.elcolombiano.com/rss/Television.xml'), + (u'Vida y Sociedad', u'http://www.elcolombiano.com/rss/Vida.xml'), + (u'Turismo', u'http://www.elcolombiano.com/rss/Turismo.xm'), + (u'Salud', u'http://www.elcolombiano.com/rss/Salud.xml'), + (u'Ciencia', u'http://www.elcolombiano.com/rss/Ciencia.xml')] + + remove_tags = [dict(name='div', attrs={'class':'objetosRelacionados'}), +dict(name='div', attrs={'class':'notasRelacionadas contenedor'}), +dict(name='div', attrs={'class':'comentarios'}), +dict(name='div', attrs={'class':'mapaDelSitio'}), +dict(name='div', attrs={'class':'creditos'}), +dict(name='div', attrs={'class':'votos'}), +dict(name='div', attrs={'class':'divopt2'}), +dict(name='div', attrs={'class':'comentarios'}), +dict(name='div', attrs={'class':'pestanasLateral'}), +dict(name='div', attrs={'class':'resumenSeccion'}), +dict(name='div', attrs={'class':'zonaComercial'}), +dict(name='div', attrs={'id':'zonaPata'})] diff --git a/recipes/el_tiempo.recipe b/recipes/el_tiempo.recipe new file mode 100644 index 0000000000..3a10cca767 --- /dev/null +++ b/recipes/el_tiempo.recipe @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- + +from calibre.web.feeds.news import BasicNewsRecipe + + + + +class ColombiaElTiempo02(BasicNewsRecipe): + title = u'Periódico el Tiempo' + language = 'es_CO' + __author__ = 'BIGO-CAVA' + cover_url = 'http://www.eltiempo.com/media/css/images/logo_footer.png' + remove_tags_before = dict(id='fb-root') + remove_tags_after = [dict(name='div', attrs={'class':'modulo reporte'})] + keep_only_tags = [dict(name='div', id='contenidoArt')] + remove_tags = [dict(name='div', attrs={'class':'social-media'}), + dict(name='div', attrs={'class':'caja-facebook'}), + dict(name='div', attrs={'class':'caja-twitter'}), + dict(name='div', attrs={'class':'caja-buzz'}), + dict(name='div', attrs={'class':'ico-mail2'}), + dict(name='div', attrs={'id':'caja-instapaper'}), + dict(name='div', attrs={'class':'modulo herramientas'})] + oldest_article = 2 + max_articles_per_feed = 100 + remove_javascript = True + no_stylesheets = True + use_embedded_content = False + remove_empty_feeds = True + masthead_url = 'http://www.eltiempo.com/media/css/images/logo_footer.png' + publication_type = 'newspaper' + + extra_css = """ + p{text-align: justify; font-size: 100%} + body{ text-align: left; font-size:100% } + h1{font-family: sans-serif; font-size:150%; font-weight:bold; text-align: justify; } + h3{font-family: sans-serif; font-size:100%; font-style: italic; text-align: justify; } + """ + + + feeds = [(u'Colombia', u'http://www.eltiempo.com/colombia/rss.xml'), + (u'Medellin', u'http://www.eltiempo.com/colombia/medellin/rss.xml'), + (u'Economia', u'http://www.eltiempo.com/economia/rss.xml'), + (u'Deportes', u'http://www.eltiempo.com/deportes/rss.xml'), + (u'Mundo', u'http://www.eltiempo.com/mundo/rss.xml'), + (u'Gente', u'http://www.eltiempo.com/gente/rss.xml'), + (u'Vida de Hoy', u'http://www.eltiempo.com/vida-de-hoy/rss.xml'), + (u'EEUU', u'http://www.eltiempo.com/mundo/estados-unidos/rss.xml'), + (u'LatinoAmerica', u'http://www.eltiempo.com/mundo/latinoamerica/rss.xml'), + (u'Europa', u'http://www.eltiempo.com/mundo/europa/rss.xml'), + (u'Medio Oriente', u'http://www.eltiempo.com/mundo/medio-oriente/rss.xml'), + (u'Vive in Medellin', u'http://medellin.vive.in/medellin/rss.xml'), + (u'Don Juan', u'http://www.revistadonjuan.com/feedrss/'), + (u'Alo', u'http://www.eltiempo.com/alo/rss.xml')] diff --git a/recipes/portafolio.recipe b/recipes/portafolio.recipe new file mode 100644 index 0000000000..1b442f68f7 --- /dev/null +++ b/recipes/portafolio.recipe @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- + +from calibre.web.feeds.news import BasicNewsRecipe + +class AdvancedUserRecipe1311799898(BasicNewsRecipe): + title = u'Periódico Portafolio Colombia' + language = 'es_CO' + __author__ = 'BIGO-CAVA' + cover_url = 'http://www.portafolio.co/sites/portafolio.co/themes/portafolio_2011/logo.png' + remove_tags_before = dict(id='contenidoArt') + remove_tags_after = [dict(name='div', attrs={'class':'articulo-mas'})] + keep_only_tags = [dict(name='div', id='contenidoArt')] + oldest_article = 1 + max_articles_per_feed = 100 + remove_javascript = True + no_stylesheets = True + use_embedded_content = False + remove_empty_feeds = True + masthead_url = 'http://www.portafolio.co/sites/portafolio.co/themes/portafolio_2011/logo.png' + publication_type = 'newspaper' + + extra_css = """ + p{text-align: justify; font-size: 100%} + body{ text-align: left; font-size:100% } + h1{font-family: sans-serif; font-size:150%; font-weight:bold; text-align: justify; } + h3{font-family: sans-serif; font-size:100%; font-style: italic; text-align: justify; } + """ + + + feeds = [(u'Negocios', u'http://www.portafolio.co/negocios/feed'), + (u'Economia', u'http://www.portafolio.co/economia/feed'), + (u'Internacional', u'http://www.portafolio.co/internacional/feed'), + (u'Indicadores', u'http://www.portafolio.co/indicadores/feed'), + (u'Opinion', u'http://www.portafolio.co/opinion/feed'), + (u'Finanzas Personales', u'http://www.portafolio.co/finanzas-personales/feed'), + (u'Herramientas', u'http://www.portafolio.co/herramientas/feed')] diff --git a/src/calibre/utils/localization.py b/src/calibre/utils/localization.py index 39cb228d60..8d161b064a 100644 --- a/src/calibre/utils/localization.py +++ b/src/calibre/utils/localization.py @@ -140,6 +140,7 @@ _extra_lang_codes = { 'es_VE' : _('Spanish (Venezuela)'), 'es_BO' : _('Spanish (Bolivia)'), 'es_NI' : _('Spanish (Nicaragua)'), + 'es_CO' : _('Spanish (Colombia)'), 'de_AT' : _('German (AT)'), 'fr_BE' : _('French (BE)'), 'nl' : _('Dutch (NL)'),