mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Improved Il Messagero and Leggo (it)
This commit is contained in:
parent
6fcff2462e
commit
ec208049c5
@ -7,14 +7,14 @@ description = 'Italian daily newspaper - v1.01 (04, January 2010)'
|
|||||||
'''
|
'''
|
||||||
http://www.messaggero.it/
|
http://www.messaggero.it/
|
||||||
'''
|
'''
|
||||||
|
import time
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class IlMessaggero(BasicNewsRecipe):
|
class IlMessaggero(BasicNewsRecipe):
|
||||||
__author__ = 'Gabriele Marini'
|
__author__ = 'Gabriele Marini'
|
||||||
description = 'Italian News'
|
description = 'Italian News'
|
||||||
|
|
||||||
cover_url = 'http://www.ilmessaggero.it/img_tst/logomsgr.gif'
|
# cover_url = 'http://www.ilmessaggero.it/img_tst/logomsgr.gif'
|
||||||
title = u'Il Messaggero'
|
title = u'Il Messaggero'
|
||||||
publisher = 'Caltagirone Editore'
|
publisher = 'Caltagirone Editore'
|
||||||
category = 'News, politics, culture, economy, general interest'
|
category = 'News, politics, culture, economy, general interest'
|
||||||
@ -34,6 +34,21 @@ class IlMessaggero(BasicNewsRecipe):
|
|||||||
dict(name='h2', attrs={'class':'sottotitLettura'}),
|
dict(name='h2', attrs={'class':'sottotitLettura'}),
|
||||||
dict(name='span', attrs={'class':'testoArticoloG'})
|
dict(name='span', attrs={'class':'testoArticoloG'})
|
||||||
]
|
]
|
||||||
|
def get_cover_url(self):
|
||||||
|
cover = None
|
||||||
|
st = time.localtime()
|
||||||
|
year = str(st.tm_year)
|
||||||
|
month = "%.2d" % st.tm_mon
|
||||||
|
day = "%.2d" % st.tm_mday
|
||||||
|
cover='http://carta.ilmessaggero.it/' + year + month + day + '/jpeg/MSGR_20_CITTA_1.jpg'
|
||||||
|
br = BasicNewsRecipe.get_browser()
|
||||||
|
try:
|
||||||
|
br.open(cover)
|
||||||
|
except:
|
||||||
|
self.log("\nCover unavailable")
|
||||||
|
cover = 'http://www.ilmessaggero.it/img_tst/logomsgr.gif'
|
||||||
|
|
||||||
|
return cover
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -53,4 +68,4 @@ class IlMessaggero(BasicNewsRecipe):
|
|||||||
(u'Calcio', u'http://www.ilmessaggero.it/rss/sport_calcio.xml'),
|
(u'Calcio', u'http://www.ilmessaggero.it/rss/sport_calcio.xml'),
|
||||||
(u'Motori', u'http://www.ilmessaggero.it/rss/sport_motori.xml')
|
(u'Motori', u'http://www.ilmessaggero.it/rss/sport_motori.xml')
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -7,14 +7,14 @@ description = 'Italian daily newspaper - v1.00 05-05-2010'
|
|||||||
'''
|
'''
|
||||||
http://www.leggo.it
|
http://www.leggo.it
|
||||||
'''
|
'''
|
||||||
|
import time
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class LeggoIT(BasicNewsRecipe):
|
class LeggoIT(BasicNewsRecipe):
|
||||||
__author__ = 'Gabriele Marini'
|
__author__ = 'Gabriele Marini'
|
||||||
description = 'Italian Free daily newspaper'
|
description = 'Italian Free daily newspaper'
|
||||||
|
|
||||||
cover_url = 'http://www.leggo.it/img/logo-leggo2.gif'
|
# cover_url = 'http://www.leggo.it/img/logo-leggo2.gif'
|
||||||
title = u'Leggo.it'
|
title = u'Leggo.it'
|
||||||
publisher = 'Ced Caltagirone Editore S.p.A.'
|
publisher = 'Ced Caltagirone Editore S.p.A.'
|
||||||
category = 'News, politics, culture, economy, general interest'
|
category = 'News, politics, culture, economy, general interest'
|
||||||
@ -33,8 +33,8 @@ class LeggoIT(BasicNewsRecipe):
|
|||||||
|
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
dict(name='h1',attrs={'class':'nero22'}),
|
dict(name='h1',attrs={'class':'nero22'}),
|
||||||
dict(name='div',attrs={'id':'testodim'})
|
dict(name='div',attrs={'id':'testodim'})
|
||||||
]
|
]
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'Home Page', u'http://www.leggo.it/rss/home.xml'),
|
(u'Home Page', u'http://www.leggo.it/rss/home.xml'),
|
||||||
(u'Italia', u'http://www.leggo.it/rss/italia.xml'),
|
(u'Italia', u'http://www.leggo.it/rss/italia.xml'),
|
||||||
@ -45,5 +45,21 @@ class LeggoIT(BasicNewsRecipe):
|
|||||||
(u'Spettacoli', u'http://www.leggo.it/rss/spettacoli.xml'),
|
(u'Spettacoli', u'http://www.leggo.it/rss/spettacoli.xml'),
|
||||||
(u'Salute', u'http://www.leggo.it/rss/salute.xml'),
|
(u'Salute', u'http://www.leggo.it/rss/salute.xml'),
|
||||||
(u'Scienza', u'http://www.leggo.it/rss/scienza.xml')
|
(u'Scienza', u'http://www.leggo.it/rss/scienza.xml')
|
||||||
]
|
]
|
||||||
|
def get_cover_url(self):
|
||||||
|
cover = None
|
||||||
|
st = time.localtime()
|
||||||
|
year = str(st.tm_year)
|
||||||
|
month = "%.2d" % st.tm_mon
|
||||||
|
day = "%.2d" % st.tm_mday
|
||||||
|
cover='http://www.leggo.it/'+ year + month + day + '/jpeg/LEGGO_ROMA_1.jpg'
|
||||||
|
br = BasicNewsRecipe.get_browser()
|
||||||
|
try:
|
||||||
|
br.open(cover)
|
||||||
|
except:
|
||||||
|
self.log("\nCover unavailable")
|
||||||
|
cover = 'http://www.leggo.it/img/logo-leggo2.gif'
|
||||||
|
|
||||||
|
return cover
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user