La Nueva Espana by Luis Hernandez

This commit is contained in:
Kovid Goyal 2011-01-27 08:41:16 -07:00
parent 218da3467d
commit 601eff81cd
2 changed files with 98 additions and 2 deletions

View File

@ -0,0 +1,74 @@
# -*- coding: utf-8 -*-
__license__ = 'GPL v3'
__author__ = 'Luis Hernandez'
__copyright__ = 'Luis Hernandez<tolyluis@gmail.com>'
description = 'Diario independiente de Asturias - v1.0 - 27 Jan 2011'
'''
www.lne.es
'''
from calibre.web.feeds.news import BasicNewsRecipe
class AdvancedUserRecipe1294946868(BasicNewsRecipe):
title = u'La Nueva España'
publisher = u'Editorial Prensa Iberica'
__author__ = 'Luis Hernandez'
description = 'Diario independiente de Asturias'
cover_url = 'http://estaticos00.lne.es//elementosWeb/mediaweb/images/iconos/logo2.jpg'
oldest_article = 3
max_articles_per_feed = 100
remove_javascript = True
no_stylesheets = True
use_embedded_content = False
encoding = 'ISO-8859-1'
language = 'es'
timefmt = '[%a, %d %b, %Y]'
keep_only_tags = [
dict(name='div', attrs={'class':['noticia_titular','subtitulo','noticiadd2','noticia_texto']})
,dict(name='div', attrs={'id':['noticia_texto']})
]
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: 600; text-align: justify; } h2{ font-family: sans-serif; font-size:120%; font-weight: 500; text-align: justify } '
remove_tags_before = dict(name='div' , attrs={'class':['contenedor']})
remove_tags_after = dict(name='div' , attrs={'class':['fin_noticia']})
remove_tags = [
dict(name='div', attrs={'class':['epigrafe','antetitulo','bloqueclear','bloqueclear_video','cuadro_multimedia','cintillo2','editor_documentos','noticiadd','noticiadd3','noticiainterior','fin_noticia']})
,dict(name='div', attrs={'id':['evotos']})
]
feeds = [
(u'Al minuto' , u'http://www.lne.es/elementosInt/rss/AlMinuto')
,(u'General' , u'http://www.lne.es/elementosInt/rss/55')
,(u'Nacional' , u'http://www.lne.es/elementosInt/rss/43')
,(u'Internacional' , u'http://www.lne.es/elementosInt/rss/44')
,(u'Economia' , u'http://www.lne.es/elementosInt/rss/45')
,(u'Deportes' , u'http://www.lne.es/elementosInt/rss/47')
,(u'Campeones' , u'http://www.lne.es/elementosInt/rss/65')
,(u'Sociedad' , u'http://www.lne.es/elementosInt/rss/46')
,(u'Sucesos' , u'http://www.lne.es/elementosInt/rss/48')
,(u'Galeria' , u'http://www.lne.es/elementosInt/rss/51')
,(u'Cultura' , u'http://www.lne.es/elementosInt/rss/66')
,(u'Motor' , u'http://www.lne.es/elementosInt/rss/62')
,(u'Opinion' , u'http://www.lne.es/elementosInt/rss/52')
,(u'Asturias' , u'http://www.lne.es/elementosInt/rss/42')
,(u'Oviedo' , u'http://www.lne.es/elementosInt/rss/31')
,(u'Gijon' , u'http://www.lne.es/elementosInt/rss/35')
,(u'Aviles' , u'http://www.lne.es/elementosInt/rss/36')
,(u'Nalon' , u'http://www.lne.es/elementosInt/rss/37')
,(u'Cuencas' , u'http://www.lne.es/elementosInt/rss/38')
,(u'Caudal' , u'http://www.lne.es/elementosInt/rss/39')
,(u'Oriente' , u'http://www.lne.es/elementosInt/rss/40')
,(u'Occidente' , u'http://www.lne.es/elementosInt/rss/41')
,(u'Mar y Campo' , u'http://www.lne.es/elementosInt/rss/63')
,(u'Ultima' , u'http://www.lne.es/elementosInt/rss/50')
]

View File

@ -1,9 +1,22 @@
# -*- coding: utf-8 -*-
__license__ = 'GPL v3'
__author__ = 'Luis Hernandez'
__copyright__ = 'Luis Hernandez<tolyluis@gmail.com>'
description = 'Diario local de Talavera de la Reina - v1.2 - 27 Jan 2011'
'''
http://www.latribunadetalavera.es/
'''
from calibre.web.feeds.news import BasicNewsRecipe from calibre.web.feeds.news import BasicNewsRecipe
class AdvancedUserRecipe1294946868(BasicNewsRecipe): class AdvancedUserRecipe1294946868(BasicNewsRecipe):
title = u'La Tribuna de Talavera' title = u'La Tribuna de Talavera'
publisher = u'Grupo PROMECAL'
__author__ = 'Luis Hernández' __author__ = 'Luis Hernández'
description = 'Diario de Talavera de la Reina' description = 'Diario local de Talavera de la Reina'
cover_url = 'http://www.latribunadetalavera.es/entorno/mancheta.gif' cover_url = 'http://www.latribunadetalavera.es/entorno/mancheta.gif'
oldest_article = 5 oldest_article = 5
@ -17,7 +30,8 @@ class AdvancedUserRecipe1294946868(BasicNewsRecipe):
language = 'es' language = 'es'
timefmt = '[%a, %d %b, %Y]' timefmt = '[%a, %d %b, %Y]'
keep_only_tags = [dict(name='div', attrs={'id':['articulo']}) keep_only_tags = [
dict(name='div', attrs={'id':['articulo']})
,dict(name='div', attrs={'class':['foto']}) ,dict(name='div', attrs={'class':['foto']})
,dict(name='p', attrs={'id':['texto']}) ,dict(name='p', attrs={'id':['texto']})
] ]
@ -25,5 +39,13 @@ class AdvancedUserRecipe1294946868(BasicNewsRecipe):
remove_tags_before = dict(name='div' , attrs={'class':['comparte']}) remove_tags_before = dict(name='div' , attrs={'class':['comparte']})
remove_tags_after = dict(name='div' , attrs={'id':['relacionadas']}) 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} '
def preprocess_html(self, soup):
for alink in soup.findAll('a'):
if alink.string is not None:
tstr = alink.string
alink.replaceWith(tstr)
return soup
feeds = [(u'Portada', u'http://www.latribunadetalavera.es/rss.html')] feeds = [(u'Portada', u'http://www.latribunadetalavera.es/rss.html')]