mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Recipes for Critica de la Argentina and El Cronista by Darko Miletic
This commit is contained in:
parent
8f2f6e87fd
commit
70fd7cbfff
BIN
src/calibre/gui2/images/news/criticadigital.png
Normal file
BIN
src/calibre/gui2/images/news/criticadigital.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 710 B |
BIN
src/calibre/gui2/images/news/elcronista.png
Normal file
BIN
src/calibre/gui2/images/news/elcronista.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 770 B |
@ -23,7 +23,7 @@ recipe_modules = ['recipe_' + r for r in (
|
|||||||
'spiegel_int', 'themarketticker', 'tomshardware', 'xkcd', 'ftd', 'zdnet',
|
'spiegel_int', 'themarketticker', 'tomshardware', 'xkcd', 'ftd', 'zdnet',
|
||||||
'joelonsoftware', 'telepolis', 'common_dreams', 'nin', 'tomshardware_de',
|
'joelonsoftware', 'telepolis', 'common_dreams', 'nin', 'tomshardware_de',
|
||||||
'pagina12', 'infobae', 'ambito', 'elargentino', 'sueddeutsche', 'the_age',
|
'pagina12', 'infobae', 'ambito', 'elargentino', 'sueddeutsche', 'the_age',
|
||||||
'laprensa', 'amspec', 'freakonomics',
|
'laprensa', 'amspec', 'freakonomics', 'criticadigital', 'elcronista',
|
||||||
)]
|
)]
|
||||||
|
|
||||||
import re, imp, inspect, time, os
|
import re, imp, inspect, time, os
|
||||||
|
60
src/calibre/web/feeds/recipes/recipe_criticadigital.py
Normal file
60
src/calibre/web/feeds/recipes/recipe_criticadigital.py
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
criticadigital.com
|
||||||
|
'''
|
||||||
|
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class CriticaDigital(BasicNewsRecipe):
|
||||||
|
title = 'Critica de la Argentina'
|
||||||
|
__author__ = 'Darko Miletic'
|
||||||
|
description = 'Noticias de Argentina'
|
||||||
|
oldest_article = 2
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
no_stylesheets = True
|
||||||
|
use_embedded_content = False
|
||||||
|
encoding = 'cp1252'
|
||||||
|
|
||||||
|
html2lrf_options = [
|
||||||
|
'--comment' , description
|
||||||
|
, '--category' , 'news, Argentina'
|
||||||
|
, '--publisher' , title
|
||||||
|
]
|
||||||
|
|
||||||
|
keep_only_tags = [
|
||||||
|
dict(name='div', attrs={'class':'bloqueTitulosNoticia'})
|
||||||
|
,dict(name='div', attrs={'id':'c453-1' })
|
||||||
|
]
|
||||||
|
|
||||||
|
remove_tags = [
|
||||||
|
dict(name='div', attrs={'class':'box300' })
|
||||||
|
,dict(name='div', style=True )
|
||||||
|
,dict(name='div', attrs={'class':'titcomentario'})
|
||||||
|
,dict(name='div', attrs={'class':'comentario' })
|
||||||
|
,dict(name='div', attrs={'class':'paginador' })
|
||||||
|
]
|
||||||
|
|
||||||
|
feeds = [
|
||||||
|
(u'Politica', u'http://www.criticadigital.com/herramientas/rss.php?ch=politica' )
|
||||||
|
,(u'Economia', u'http://www.criticadigital.com/herramientas/rss.php?ch=economia' )
|
||||||
|
,(u'Deportes', u'http://www.criticadigital.com/herramientas/rss.php?ch=deportes' )
|
||||||
|
,(u'Espectaculos', u'http://www.criticadigital.com/herramientas/rss.php?ch=espectaculos')
|
||||||
|
,(u'Mundo', u'http://www.criticadigital.com/herramientas/rss.php?ch=mundo' )
|
||||||
|
,(u'Policiales', u'http://www.criticadigital.com/herramientas/rss.php?ch=policiales' )
|
||||||
|
,(u'Sociedad', u'http://www.criticadigital.com/herramientas/rss.php?ch=sociedad' )
|
||||||
|
,(u'Salud', u'http://www.criticadigital.com/herramientas/rss.php?ch=salud' )
|
||||||
|
,(u'Tecnologia', u'http://www.criticadigital.com/herramientas/rss.php?ch=tecnologia' )
|
||||||
|
,(u'Santa Fe', u'http://www.criticadigital.com/herramientas/rss.php?ch=santa_fe' )
|
||||||
|
]
|
||||||
|
|
||||||
|
def get_cover_url(self):
|
||||||
|
cover_url = None
|
||||||
|
index = 'http://www.criticadigital.com/impresa/'
|
||||||
|
soup = self.index_to_soup(index)
|
||||||
|
link_item = soup.find('div',attrs={'class':'tapa'})
|
||||||
|
if link_item:
|
||||||
|
cover_url = index + link_item.img['src']
|
||||||
|
return cover_url
|
70
src/calibre/web/feeds/recipes/recipe_elcronista.py
Normal file
70
src/calibre/web/feeds/recipes/recipe_elcronista.py
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
cronista.com
|
||||||
|
'''
|
||||||
|
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class ElCronista(BasicNewsRecipe):
|
||||||
|
title = 'El Cronista'
|
||||||
|
__author__ = 'Darko Miletic'
|
||||||
|
description = 'Noticias de Argentina'
|
||||||
|
oldest_article = 2
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
no_stylesheets = True
|
||||||
|
use_embedded_content = False
|
||||||
|
encoding = 'cp1252'
|
||||||
|
|
||||||
|
html2lrf_options = [
|
||||||
|
'--comment' , description
|
||||||
|
, '--category' , 'news, Argentina'
|
||||||
|
, '--publisher' , title
|
||||||
|
]
|
||||||
|
|
||||||
|
keep_only_tags = [
|
||||||
|
dict(name='table', attrs={'width':'100%' })
|
||||||
|
,dict(name='h1' , attrs={'class':'Arialgris16normal'})
|
||||||
|
]
|
||||||
|
|
||||||
|
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 = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'
|
||||||
|
soup.head.insert(0,mtag)
|
||||||
|
soup.head.base.extract()
|
||||||
|
htext = soup.find('h1',attrs={'class':'Arialgris16normal'})
|
||||||
|
htext.name = 'p'
|
||||||
|
soup.prettify()
|
||||||
|
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
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user