From 840f316703e3f5da5ce86297448ac11f31f637fb Mon Sep 17 00:00:00 2001
From: Kovid Goyal
Date: Fri, 9 Aug 2013 15:29:29 +0530
Subject: [PATCH] Update El Periodica de Aragon and El Correo
---
recipes/el_correo.recipe | 47 +++++++++++++++++--------------------
recipes/el_periodico.recipe | 18 +++++++-------
2 files changed, 30 insertions(+), 35 deletions(-)
diff --git a/recipes/el_correo.recipe b/recipes/el_correo.recipe
index 110c19d7ba..235d5e0fc7 100644
--- a/recipes/el_correo.recipe
+++ b/recipes/el_correo.recipe
@@ -3,10 +3,10 @@ __license__ = 'GPL v3'
__copyright__ = '08 Januery 2011, desUBIKado'
__author__ = 'desUBIKado'
__description__ = 'Daily newspaper from Biscay'
-__version__ = 'v0.08'
-__date__ = '08, Januery 2011'
+__version__ = 'v0.10'
+__date__ = '07, August 2013'
'''
-[url]http://www.elcorreo.com/[/url]
+http://www.elcorreo.com/
'''
import time
@@ -24,6 +24,7 @@ class heraldo(BasicNewsRecipe):
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False
+ masthead_url = 'http://www.elcorreo.com/vizcaya/noticias/201002/02/Media/logo-elcorreo-nuevo.png'
language = 'es'
timefmt = '[%a, %d %b, %Y]'
encoding = 'iso-8859-1'
@@ -33,15 +34,15 @@ class heraldo(BasicNewsRecipe):
feeds = [
(u'Portada', u'http://www.elcorreo.com/vizcaya/portada.xml'),
(u'Local', u'http://www.elcorreo.com/vizcaya/rss/feeds/vizcaya.xml'),
- (u'Internacional', u'hhttp://www.elcorreo.com/vizcaya/rss/feeds/internacional.xml'),
- (u'Econom\xeda', u'http://www.elcorreo.com/vizcaya/rss/feeds/economia.xml'),
+ (u'Internacional', u'hhttp://www.elcorreo.com/vizcaya/rss/feeds/internacional.xml'),
+ (u'Econom\xeda', u'http://www.elcorreo.com/vizcaya/rss/feeds/economia.xml'),
(u'Pol\xedtica', u'http://www.elcorreo.com/vizcaya/rss/feeds/politica.xml'),
- (u'Opini\xf3n', u'http://www.elcorreo.com/vizcaya/rss/feeds/opinion.xml'),
- (u'Deportes', u'http://www.elcorreo.com/vizcaya/rss/feeds/deportes.xml'),
+ (u'Opini\xf3n', u'http://www.elcorreo.com/vizcaya/rss/feeds/opinion.xml'),
+ (u'Deportes', u'http://www.elcorreo.com/vizcaya/rss/feeds/deportes.xml'),
(u'Sociedad', u'http://www.elcorreo.com/vizcaya/rss/feeds/sociedad.xml'),
- (u'Cultura', u'http://www.elcorreo.com/vizcaya/rss/feeds/cultura.xml'),
- (u'Televisi\xf3n', u'http://www.elcorreo.com/vizcaya/rss/feeds/television.xml'),
- (u'Gente', u'http://www.elcorreo.com/vizcaya/rss/feeds/gente.xml')
+ (u'Cultura', u'http://www.elcorreo.com/vizcaya/rss/feeds/cultura.xml'),
+ (u'Televisi\xf3n', u'http://www.elcorreo.com/vizcaya/rss/feeds/television.xml'),
+ (u'Gente', u'http://www.elcorreo.com/vizcaya/rss/feeds/gente.xml')
]
keep_only_tags = [
@@ -54,14 +55,14 @@ class heraldo(BasicNewsRecipe):
dict(name='div', attrs={'class':['mod_lomas','bloque_lomas','blm_header','link-app3','link-app4','botones_listado']}),
dict(name='div', attrs={'class':['navegacion_galeria','modulocanalpromocion','separa','separacion','compartir','tags_relacionados']}),
dict(name='div', attrs={'class':['moduloBuscadorDeportes','modulo-gente','moddestacadopeq','OpcArt','articulopiniones']}),
- dict(name='div', attrs={'class':['modulo-especial','publiEspecial']}),
- dict(name='div', attrs={'id':['articulopina']}),
+ dict(name='div', attrs={'class':['modulo-especial','publiEspecial','carruselNoticias','vj','modulocomun2']}),
+ dict(name='div', attrs={'id':['articulopina','webs_asociadas']}),
dict(name='br', attrs={'class':'clear'}),
dict(name='form', attrs={'name':'frm_conversor2'})
]
remove_tags_before = dict(name='div' , attrs={'class':'articulo '})
- remove_tags_after = dict(name='div' , attrs={'class':'comentarios'})
+ remove_tags_after = dict(name='div' , attrs={'class':'robapaginas'})
def get_cover_url(self):
cover = None
@@ -69,10 +70,8 @@ class heraldo(BasicNewsRecipe):
year = str(st.tm_year)
month = "%.2d" % st.tm_mon
day = "%.2d" % st.tm_mday
- #[url]http://img.kiosko.net/2011/01/02/es/elcorreo.750.jpg[/url]
- #[url]http://info.elcorreo.com/pdf/06012011-viz.pdf[/url]
- cover='http://info.elcorreo.com/pdf/'+ day + month + year +'-viz.pdf'
-
+ # http://info.elcorreo.com/pdf/07082013-viz.pdf
+ cover='http://info.elcorreo.com/pdf/'+ day + month + year +'-viz.pdf'
br = BasicNewsRecipe.get_browser(self)
try:
br.open(cover)
@@ -92,29 +91,27 @@ class heraldo(BasicNewsRecipe):
img{margin-bottom: 0.4em}
'''
-
-
preprocess_regexps = [
- # To present the image of the embedded video
+ # Para presentar la imagen de los video incrustados
(re.compile(r'var RUTA_IMAGEN', re.DOTALL|re.IGNORECASE), lambda match: '
'),
(re.compile(r'var SITIO = "elcorreo";', re.DOTALL|re.IGNORECASE), lambda match: '
', re.DOTALL|re.IGNORECASE), lambda match: '
'),
-# To put a blank line between the intro of the embedded videos and the previous text
+# Para poner una linea en blanco entre la entradilla de los videos incrustados y el texto anterior
(re.compile(r'
\n
\n', re.DOTALL|re.IGNORECASE), lambda match: ''),
diff --git a/recipes/el_periodico.recipe b/recipes/el_periodico.recipe
index abdf537fbe..ecdf458c2e 100644
--- a/recipes/el_periodico.recipe
+++ b/recipes/el_periodico.recipe
@@ -5,8 +5,8 @@ __license__ = 'GPL v3'
__copyright__ = '04 December 2010, desUBIKado'
__author__ = 'desUBIKado'
__description__ = 'Daily newspaper from Aragon'
-__version__ = 'v0.08'
-__date__ = '13, November 2011'
+__version__ = 'v0.09'
+__date__ = '07, August 2013'
'''
elperiodicodearagon.com
'''
@@ -25,11 +25,11 @@ class elperiodicodearagon(BasicNewsRecipe):
no_stylesheets = True
use_embedded_content = False
language = 'es'
+ masthead_url = 'http://pdf.elperiodicodearagon.com/img/logotipo.gif'
encoding = 'iso-8859-1'
remove_empty_feeds = True
remove_javascript = True
-
conversion_options = {
'comments' : description
,'tags' : category
@@ -56,23 +56,21 @@ class elperiodicodearagon(BasicNewsRecipe):
(u'Fiestas del Pilar', u'http://zetaestaticos.com/aragon/rss/107_es.xml')
]
-
remove_attributes = ['height','width']
keep_only_tags = [dict(name='div', attrs={'id':'Noticia'})]
-
# Recuperamos la portada de papel (la imagen format=1 tiene mayor resolucion)
-
def get_cover_url(self):
- index = 'http://pdf.elperiodicodearagon.com/'
+ index = 'http://pdf.elperiodicodearagon.com/edicion.php'
soup = self.index_to_soup(index)
for image in soup.findAll('img',src=True):
- if image['src'].startswith('http://pdf.elperiodicodearagon.com/funciones/portada-preview.php?eid='):
- return image['src'].rstrip('format=2') + 'format=1'
+ if image['src'].startswith('/funciones/img-public.php?key='):
+ return 'http://pdf.elperiodicodearagon.com' + image['src']
return None
# Usamos la versión para móviles
def print_version(self, url):
- return url.replace('http://www.elperiodicodearagon.com/', 'http://www.elperiodicodearagon.com/m/')
+ return url.replace('http://www.elperiodicodearagon.com/', 'http://www.elperiodicodearagon.com/m/')
+