From 23ffe549a0f3dcb5cfaded30947603d383678025 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 2 Feb 2011 16:10:15 -0700 Subject: [PATCH] Improve La Tribua de --- resources/recipes/la_tribuna.recipe | 43 ++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/resources/recipes/la_tribuna.recipe b/resources/recipes/la_tribuna.recipe index 739d11cc8d..c6d3f5cb28 100644 --- a/resources/recipes/la_tribuna.recipe +++ b/resources/recipes/la_tribuna.recipe @@ -2,24 +2,23 @@ __license__ = 'GPL v3' __author__ = 'Luis Hernandez' __copyright__ = 'Luis Hernandez' -description = 'Diario local de Talavera de la Reina - v1.2 - 27 Jan 2011' +__version__ = 'v1.0' +__date__ = '01 Feb 2011' ''' -http://www.latribunadetalavera.es/ +http://www.promecal.es/ ''' - from calibre.web.feeds.news import BasicNewsRecipe class AdvancedUserRecipe1294946868(BasicNewsRecipe): - title = u'La Tribuna de Talavera' + title = u'La Tribuna de' publisher = u'Grupo PROMECAL' __author__ = 'Luis Hernández' - description = 'Diario local de Talavera de la Reina' - cover_url = 'http://www.latribunadetalavera.es/entorno/mancheta.gif' + description = 'Varios diarios locales del grupo PROMECAL' - oldest_article = 5 + oldest_article = 3 max_articles_per_feed = 50 remove_javascript = True @@ -27,7 +26,7 @@ class AdvancedUserRecipe1294946868(BasicNewsRecipe): use_embedded_content = False encoding = 'utf-8' - language = 'es' + language = 'es_ES' timefmt = '[%a, %d %b, %Y]' keep_only_tags = [ @@ -39,7 +38,20 @@ class AdvancedUserRecipe1294946868(BasicNewsRecipe): remove_tags_before = dict(name='div' , attrs={'class':['comparte']}) remove_tags_after = dict(name='div' , attrs={'id':['relacionadas']}) - extra_css = ' p{text-align: justify; font-size: 100%} body{ text-align: left; font-family: serif; font-size: 100% } h1{ font-family: sans-serif; font-size:150%; font-weight: 700; text-align: justify; } h2{ font-family: sans-serif; font-size:120%; font-weight: 600; text-align: justify } h3{ font-family: sans-serif; font-size:60%; font-weight: 600; text-align: left } h4{ font-family: sans-serif; font-size:80%; font-weight: 600; text-align: left } h5{ font-family: sans-serif; font-size:70%; font-weight: 600; text-align: left }img{margin-bottom: 0.4em} ' + remove_tags = [ + dict(name='div', attrs={'id':['relacionadas']}) + ,dict(name='h3') + ,dict(name='h5') + ] + + extra_css = """ + p{text-align: justify; font-size: 100%} + body{text-align: left; font-family: serif; font-size: 100%} + h1{font-family: sans; font-size:150%; font-weight: bold; text-align: justify;} + h2{font-family: sans-serif; font-size:85%; font-style: italic; text-align: justify;} + h4{font-family: sans; font-size:75%; font-weight: bold; text-align: center;} + img{margin-bottom: 0.4em} + """ def preprocess_html(self, soup): for alink in soup.findAll('a'): @@ -48,4 +60,15 @@ class AdvancedUserRecipe1294946868(BasicNewsRecipe): alink.replaceWith(tstr) return soup - feeds = [(u'Portada', u'http://www.latribunadetalavera.es/rss.html')] + + feeds = [ + (u'Albacete', u'http://www.latribunadealbacete.es/rss.html') + ,(u'Avila', u'http://www.diariodeavila.es/rss.html') + ,(u'Burgos', u'http://www.diariodeburgos.es/rss.html') + ,(u'Ciudad Real', u'http://www.latribunadeciudadreal.es/rss.html') + ,(u'Palencia', u'http://www.diariopalentino.es/rss.html') + ,(u'Puertollano', u'http://www.latribunadepuertollano.es/rss.html') + ,(u'Talavera de la Reina', u'http://www.latribunadetalavera.es/rss.html') + ,(u'Toledo', u'http://www.latribunadetoledo.es/rss.html') + ,(u'Valladolid', u'http://www.eldiadevalladolid.com/rss.html') + ]