mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Le Scienze
Fixes #1615376 [replace lescienze.recipe not working anymore](https://bugs.launchpad.net/calibre/+bug/1615376)
This commit is contained in:
parent
fa1aad42c5
commit
725b0067ae
@ -1,77 +1,48 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python2
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__author__ = 'Lorenzo Vigentini'
|
__author__ = 'Daniele Forsi'
|
||||||
__copyright__ = '2009, Lorenzo Vigentini <l.vigentini at gmail.com>'
|
|
||||||
__version__ = 'v1.01'
|
|
||||||
__date__ = '10, January 2010'
|
|
||||||
__description__ = 'Monthly Italian edition of Scientific American, 16.05.2010 new version'
|
|
||||||
|
|
||||||
'''
|
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||||
http://lescienze.espresso.repubblica.it/
|
|
||||||
'''
|
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
|
||||||
|
|
||||||
|
|
||||||
class leScienze(BasicNewsRecipe):
|
|
||||||
__author__ = 'Lorenzo Vigentini, Gabriele Marini'
|
|
||||||
description = 'Monthly Italian edition of Scientific American'
|
|
||||||
|
|
||||||
cover_url = 'http://lescienze.espresso.repubblica.it/images/logo_lescienze.gif'
|
|
||||||
title = 'le Scienze'
|
|
||||||
publisher = 'Gruppo editoriale L\'Espresso'
|
|
||||||
category = 'Science, general interest'
|
|
||||||
|
|
||||||
|
class LeScienze(BasicNewsRecipe):
|
||||||
|
title = 'Le Scienze'
|
||||||
|
description = 'Edizione italiana di Scientific American'
|
||||||
|
publication_type = 'magazine'
|
||||||
language = 'it'
|
language = 'it'
|
||||||
# encoding = 'cp1252'
|
conversion_options = {
|
||||||
timefmt = '[%a, %d %b, %Y]'
|
'publisher': 'Le Scienze S.p.A.',
|
||||||
|
'tags': 'science',
|
||||||
|
}
|
||||||
|
|
||||||
oldest_article = 100
|
INDEX = 'http://www.lescienze.it/utility/2011/10/17/news/lista_rss-589690/'
|
||||||
max_articles_per_feed = 100
|
masthead_url = 'http://www.lescienze.it/static/images/logo-le-scienze.png'
|
||||||
use_embedded_content = False
|
|
||||||
recursion = 20
|
|
||||||
|
|
||||||
remove_javascript = True
|
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
|
extra_css = '''
|
||||||
|
.img-left,.img-right{font-style:italic;font-size:75%;padding:1em;margin:auto;}
|
||||||
|
.summary{font-style:italic;font-size:120%;}
|
||||||
|
'''
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
dict(name='div', attrs={'class': 'bigbox'})
|
dict(name='article', attrs={'class': 'main-article'}),
|
||||||
]
|
]
|
||||||
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(name='span', attrs={'class': 'linkindice'}),
|
dict(attrs={'class': [
|
||||||
dict(name='div', attrs={'class': 'box-commenti'}),
|
'adv adv-middle',
|
||||||
dict(name='div', attrs={'id': ['rssdiv', 'blocco']})
|
'colsx',
|
||||||
|
'correlati',
|
||||||
|
'social-toolbar-foot',
|
||||||
|
'tags',
|
||||||
|
]}),
|
||||||
]
|
]
|
||||||
remove_tags_after = [dict(name='div', attrs={'class': 'box-commenti'})]
|
remove_empty_feeds = True
|
||||||
|
|
||||||
feeds = [
|
def get_feeds(self):
|
||||||
|
soup = self.index_to_soup(self.INDEX)
|
||||||
|
feeds = []
|
||||||
|
|
||||||
(u'Home', u'http://data.kataweb.it/rss/scienze'),
|
for link in soup.findAll('a'):
|
||||||
(u'Antropologia', u'http://data.kataweb.it/rss/scienze/antropologia'),
|
href = link.get('href')
|
||||||
(u'Archeologia', u'http://data.kataweb.it/rss/scienze/archeologia'),
|
if href.endswith('.xml'):
|
||||||
(u'Arte e Musica', u'http://data.kataweb.it/rss/scienze/arte_e_musica'),
|
title = link.string
|
||||||
(u'Astrofisica', u'http://data.kataweb.it/rss/scienze/astrofisica'),
|
feeds.append((title, href))
|
||||||
(u'Astronautica', u'http://data.kataweb.it/rss/scienze/astronautica'),
|
|
||||||
(u'Astronomia', u'http://data.kataweb.it/rss/scienze/astronomia_e_cosmologia'),
|
return feeds
|
||||||
(u'Biologia', u'http://data.kataweb.it/rss/scienze/biologia'),
|
|
||||||
(u'Chimica', u'http://data.kataweb.it/rss/scienze/chimica'),
|
|
||||||
(u'Ecologia & ambiente', u'http://data.kataweb.it/rss/scienze/ecologia_e_ambiente'),
|
|
||||||
(u'Economia', u'http://data.kataweb.it/rss/scienze/Economia'),
|
|
||||||
(u'Fisica', u'http://data.kataweb.it/rss/scienze/Fisica'),
|
|
||||||
(u'Informatica', u'http://data.kataweb.it/rss/scienze/informatica_e_telecomunicazioni'),
|
|
||||||
(u'Ingegneria', u'http://data.kataweb.it/rss/scienze/ingegneria_e_tecnologia'),
|
|
||||||
(u'Matematica', u'http://data.kataweb.it/rss/scienze/Matematica'),
|
|
||||||
(u'Medicina', u'http://data.kataweb.it/rss/scienze/Medicina'),
|
|
||||||
(u'Paleontologia', u'http://data.kataweb.it/rss/scienze/Paleontologia'),
|
|
||||||
(u'Recensioni', u'http://data.kataweb.it/rss/scienze/Recensioni'),
|
|
||||||
(u'Psicologia', u'http://data.kataweb.it/rss/scienze/psicologie_e_scienze_cognitive'),
|
|
||||||
(u'Scienze della Terra', u'http://data.kataweb.it/rss/scienze/scienze_della_terra'),
|
|
||||||
(u'Scienze dello spazio',
|
|
||||||
u'http://data.kataweb.it/rss/scienze/scienze_dello_spazio'),
|
|
||||||
(u'Scienze naturali', u'http://data.kataweb.it/rss/scienze/scienze_naturali'),
|
|
||||||
(u'Scienze sociali', u'http://data.kataweb.it/rss/scienze/scienze_sociali'),
|
|
||||||
(u'Statistica', u'http://data.kataweb.it/rss/scienze/statistica'),
|
|
||||||
(u'Storia della scienza',
|
|
||||||
u'http://data.kataweb.it/rss/scienze/storia_della_scienza')
|
|
||||||
]
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user