Update Telam

Fixes #1499844 [Updated recipe for Telam](https://bugs.launchpad.net/calibre/+bug/1499844)
This commit is contained in:
Kovid Goyal 2015-09-26 08:52:32 +05:30
parent ffff07bdd3
commit 6ede52c40d
2 changed files with 14 additions and 28 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 594 B

View File

@ -1,5 +1,5 @@
__license__ = 'GPL v3'
__copyright__ = '2012, Darko Miletic <darko.miletic at gmail.com>'
__copyright__ = '2012-2015, Darko Miletic <darko.miletic at gmail.com>'
'''
www.telam.com.ar
'''
@ -15,12 +15,13 @@ class Telam(BasicNewsRecipe):
oldest_article = 2
max_articles_per_feed = 200
no_stylesheets = True
encoding = 'utf8'
encoding = 'windows-1252'
use_embedded_content = False
language = 'es_AR'
remove_empty_feeds = True
auto_cleanup = True
publication_type = 'newsportal'
masthead_url = 'http://www.telam.com.ar/front/imagenes/encabezado/logotelam.jpg'
masthead_url = 'http://www.telam.com.ar/img/logo_small.png'
extra_css = """
body{font-family: Arial,Helvetica,sans-serif }
img{margin-bottom: 0.4em; display:block}
@ -33,30 +34,15 @@ class Telam(BasicNewsRecipe):
, 'language' : language
}
remove_tags = [dict(name=['meta','link'])]
remove_tags_before = dict(attrs={'class':'nota_fecha'})
remove_tags_after = dict(attrs={'class':'nota_completa'})
remove_attributes = ['lang']
feeds = [
(u'Ultimas noticias', u'http://www.telam.com.ar/xml/rss/' )
,(u'Politica' , u'http://www.telam.com.ar/xml/rss/1')
,(u'Economia' , u'http://www.telam.com.ar/xml/rss/2')
,(u'Sociedad' , u'http://www.telam.com.ar/xml/rss/3')
,(u'Policiales' , u'http://www.telam.com.ar/xml/rss/4')
,(u'Internacionales' , u'http://www.telam.com.ar/xml/rss/6')
,(u'Espectaculos' , u'http://www.telam.com.ar/xml/rss/7')
,(u'Cultura' , u'http://www.telam.com.ar/xml/rss/8')
,(u'Deportes' , u'http://www.telam.com.ar/xml/rss/9')
,(u'Telam Investiga' , u'http://www.telam.com.ar/xml/rss/5')
(u'Ultimas noticias', u'http://www.telam.com.ar/rss2/ultimasnoticas.xml' )
,(u'Politica' , u'http://www.telam.com.ar/rss2/politica.xml' )
,(u'Economia' , u'http://www.telam.com.ar/rss2/economia.xml' )
,(u'Sociedad' , u'http://www.telam.com.ar/rss2/sociedad.xml' )
,(u'Policiales' , u'http://www.telam.com.ar/rss2/policiales.xml' )
,(u'Internacionales' , u'http://www.telam.com.ar/rss2/mundo.xml' )
,(u'Espectaculos' , u'http://www.telam.com.ar/rss2/espectaculos.xml' )
,(u'Cultura' , u'http://www.telam.com.ar/rss2/cultura.xml' )
,(u'Deportes' , u'http://www.telam.com.ar/rss2/deportes.xml' )
,(u'Opinion' , u'http://www.telam.com.ar/rss2/opinion.xml' )
]
def print_version(self, url):
artid = url.rpartition('/')[2]
return 'http://www.telam.com.ar/?codProg=imprimir-nota&id=' + artid
def preprocess_html(self, soup):
for item in soup.findAll(style=True):
del item['style']
return soup