From ca69bebe03f5367891bd7afe1b67ec3f8972ab59 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 29 Jun 2011 11:39:28 -0600 Subject: [PATCH] Fix #803562 (Updated recipe for El Cronista) --- recipes/elcronista.recipe | 99 +++++++++++++++-------------------- recipes/icons/elcronista.png | Bin 770 -> 1143 bytes 2 files changed, 43 insertions(+), 56 deletions(-) diff --git a/recipes/elcronista.recipe b/recipes/elcronista.recipe index 93615f8f42..f8da81c4bb 100644 --- a/recipes/elcronista.recipe +++ b/recipes/elcronista.recipe @@ -1,72 +1,59 @@ -#!/usr/bin/env python - __license__ = 'GPL v3' -__copyright__ = '2008, Darko Miletic ' +__copyright__ = '2008-2011, Darko Miletic ' ''' -cronista.com +www.cronista.com ''' from calibre.web.feeds.news import BasicNewsRecipe -class ElCronista(BasicNewsRecipe): - title = 'El Cronista' +class Pagina12(BasicNewsRecipe): + title = 'El Cronista Comercial' __author__ = 'Darko Miletic' - description = 'Noticias de Argentina' + description = 'El Cronista Comercial es el Diario economico-politico mas valorado. Es la fuente mas confiable de informacion en temas de economia, finanzas y negocios enmarcados politicamente.' + publisher = 'Cronista.com' + category = 'news, politics, economy, finances, Argentina' oldest_article = 2 - language = 'es_AR' - - max_articles_per_feed = 100 + max_articles_per_feed = 200 no_stylesheets = True + encoding = 'utf8' use_embedded_content = False - encoding = 'cp1252' + language = 'es_AR' + remove_empty_feeds = True + publication_type = 'newspaper' + masthead_url = 'http://www.cronista.com/export/sites/diarioelcronista/arte/header-logo.gif' + extra_css = """ + body{font-family: Arial,Helvetica,sans-serif } + h2{font-family: Georgia,"Times New Roman",Times,serif } + img{margin-bottom: 0.4em; display:block} + .nom{font-weight: bold; vertical-align: baseline} + .autor-cfoto{border-bottom: 1px solid #D2D2D2; + border-top: 1px solid #D2D2D2; + display: inline-block; + margin: 0 10px 10px 0; + padding: 10px; + width: 210px} + .under{font-weight: bold} + .time{font-size: small} + """ - html2lrf_options = [ - '--comment' , description - , '--category' , 'news, Argentina' - , '--publisher' , title - ] + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } - keep_only_tags = [ - dict(name='table', attrs={'width':'100%' }) - ,dict(name='h1' , attrs={'class':'Arialgris16normal'}) - ] + remove_tags = [ + dict(name=['meta','link','base','iframe','object','embed']) + ,dict(attrs={'class':['user-tools','tabsmedia']}) + ] + remove_attributes = ['lang'] + remove_tags_before = dict(attrs={'class':'top'}) + remove_tags_after = dict(attrs={'class':'content-nota'}) + feeds = [(u'Ultimas noticias', u'http://www.cronista.com/rss.html')] - remove_tags = [dict(name='a', attrs={'class':'Arialazul12'})] - - feeds = [ - (u'Economia' , u'http://www.cronista.com/adjuntos/8/rss/Economia_EI.xml' ) - ,(u'Negocios' , u'http://www.cronista.com/adjuntos/8/rss/negocios_EI.xml' ) - ,(u'Ultimo momento' , u'http://www.cronista.com/adjuntos/8/rss/ultimo_momento.xml' ) - ,(u'Finanzas y Mercados' , u'http://www.cronista.com/adjuntos/8/rss/Finanzas_Mercados_EI.xml' ) - ,(u'Financial Times' , u'http://www.cronista.com/adjuntos/8/rss/FT_EI.xml' ) - ,(u'Opinion edicion impresa' , u'http://www.cronista.com/adjuntos/8/rss/opinion_edicion_impresa.xml' ) - ,(u'Socialmente Responsables', u'http://www.cronista.com/adjuntos/8/rss/Socialmente_Responsables.xml') - ,(u'Asuntos Legales' , u'http://www.cronista.com/adjuntos/8/rss/asuntoslegales.xml' ) - ,(u'IT Business' , u'http://www.cronista.com/adjuntos/8/rss/itbusiness.xml' ) - ,(u'Management y RR.HH.' , u'http://www.cronista.com/adjuntos/8/rss/management.xml' ) - ,(u'Inversiones Personales' , u'http://www.cronista.com/adjuntos/8/rss/inversionespersonales.xml' ) - ] - - def print_version(self, url): - main, sep, rest = url.partition('.com/notas/') - article_id, lsep, rrest = rest.partition('-') - return 'http://www.cronista.com/interior/index.php?p=imprimir_nota&idNota=' + article_id def preprocess_html(self, soup): - mtag = '' - soup.head.insert(0,mtag) - soup.head.base.extract() - htext = soup.find('h1',attrs={'class':'Arialgris16normal'}) - htext.name = 'p' - soup.prettify() + for item in soup.findAll(style=True): + del item['style'] return soup - - def get_cover_url(self): - cover_url = None - index = 'http://www.cronista.com/contenidos/' - soup = self.index_to_soup(index + 'ee.html') - link_item = soup.find('a',attrs={'href':"javascript:Close()"}) - if link_item: - cover_url = index + link_item.img['src'] - return cover_url - diff --git a/recipes/icons/elcronista.png b/recipes/icons/elcronista.png index 0be856345ed80377ab3da76701ecfca025005b05..ca64756de125ca72157416b01a0ecb90c47468ca 100644 GIT binary patch literal 1143 zcmV--1c>{IP)xPX9EL16fXsLZ;}xwW>gi))*jCQIFty>xAsCAP_46911SOOq{4mi@3L zYtk6gWNK&Ey;rHaNn45F)T*=yR(VsdT;cM5U)Vt?TyABs$oIEK znh(VScqmCH!FZ)qEU&Jrsnw~JHENZ@{@D86wZR}B8u;|`>9c*s0ZE$L@ovm5EI(XW za6DP}czv;WVqZ^qLNr23s2W|3?~a+x|b3N;s^G zL&IZc%Ocn!6ToG;Vt#aZWc2U*mTYtZf}A|jHSpQTg`%gH2_w4pBWHWh9Fj>{raS;i z5)_}t1=B>Uy zRb4X&V$Xb56+$8K*JI|Ps}MffN^#{7K<|{w6-)i==3E&gc3W4jSX@}#A0YAPE5+r^{#2LL2Iq$wMK zq^Z&i!~as|9{l#}?d#VEL*WS1Ha0c}F6RLOnH{K=3aO-mW!tb?4j4TLkW`2e1Yy}W zU7oT5o~y0TR?(~;uG-25kjUgMIvu#>Oxud}aR7Cf2LN>JXa}fvOq&lyXHBNE0Xn;S z+S~G8o=`YyxI5`{IZBKbi$=U2x69>>gzMzjnlmf6>m%hIG z<&`f!Uo=11AJBUErE|S+z;JF56#YN$jNhNROAW@=A$VrIbs=sdNBuuxASm1aoNvUY&tYF1`BN zsUiR%&?j%XovSNL7PEPNY1NMf3VCu;9Ri|n)^@z0Z)ty}?fF(oWp!~t21Ajd5FQNT zn~&xl8!ne;3mgeSQfaG3rK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