From 63dabd9789b74a32d1fc0ea6bd7a8b254abbb2c4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 12 Oct 2010 09:07:18 -0600 Subject: [PATCH] Fix #7150 (Updated recipe for chilean news portal El Mercurio) --- resources/recipes/el_mercurio_chile.recipe | 51 +++++++++------------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/resources/recipes/el_mercurio_chile.recipe b/resources/recipes/el_mercurio_chile.recipe index e08a21d33a..a8371f5af9 100644 --- a/resources/recipes/el_mercurio_chile.recipe +++ b/resources/recipes/el_mercurio_chile.recipe @@ -1,7 +1,5 @@ -#!/usr/bin/env python - __license__ = 'GPL v3' -__copyright__ = '2009, Darko Miletic ' +__copyright__ = '2009-2010, Darko Miletic ' ''' emol.com ''' @@ -19,43 +17,34 @@ class ElMercurio(BasicNewsRecipe): no_stylesheets = True use_embedded_content = False encoding = 'cp1252' - cover_url = 'http://www.emol.com/especiales/logo_emol/logo_emol.gif' + masthead_url = 'http://www.emol.com/especiales/logo_emol/logo_emol.gif' remove_javascript = True use_embedded_content = False + language = 'es' + - html2lrf_options = [ - '--comment', description - , '--category', category - , '--publisher', publisher - ] - - html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"' - - keep_only_tags = [ - dict(name='div', attrs={'class':'despliegue-txt_750px'}) - ,dict(name='div', attrs={'id':'div_cuerpo_participa'}) - ] - - remove_tags = [ - dict(name='div', attrs={'class':'contenedor_despliegue-col-left300'}) - ,dict(name='div', attrs={'id':['div_centro_dn_opc','div_cabezera','div_secciones','div_contenidos','div_pie','nav']}) - ] + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + keep_only_tags = [dict(name='div', attrs={'id':['cont_iz_titulobajada','cont_iz_creditos_1_a','cont_iz_cuerpo']})] + remove_tags = [dict(name='div', attrs={'id':'cont_iz_cuerpo_relacionados'})] + remove_attributes = ['height','width'] + feeds = [ - (u'Noticias de ultima hora', u'http://www.emol.com/rss20/rss.asp?canal=0') - ,(u'Nacional', u'http://www.emol.com/rss20/rss.asp?canal=1') - ,(u'Mundo', u'http://www.emol.com/rss20/rss.asp?canal=2') - ,(u'Deportes', u'http://www.emol.com/rss20/rss.asp?canal=4') - ,(u'Magazine', u'http://www.emol.com/rss20/rss.asp?canal=6') - ,(u'Tecnologia', u'http://www.emol.com/rss20/rss.asp?canal=5') - ,(u'La Musica', u'http://www.emol.com/rss20/rss.asp?canal=7') + (u'Noticias de ultima hora', u'http://rss.emol.com/rss.asp?canal=0') + ,(u'Nacional', u'http://rss.emol.com/rss.asp?canal=1') + ,(u'Mundo', u'http://rss.emol.com/rss.asp?canal=2') + ,(u'Deportes', u'http://rss.emol.com/rss.asp?canal=4') + ,(u'Magazine', u'http://rss.emol.com/rss.asp?canal=6') + ,(u'Tecnologia', u'http://rss.emol.com/rss.asp?canal=5') ] def preprocess_html(self, soup): - mtag = '' - soup.head.insert(0,mtag) for item in soup.findAll(style=True): del item['style'] return soup - language = 'es'