mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Il Giornale by Marini Gabriele
This commit is contained in:
parent
b33008a40f
commit
73ba818428
60
resources/recipes/il_giornale.recipe
Normal file
60
resources/recipes/il_giornale.recipe
Normal file
@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env python
|
||||
__license__ = 'GPL v3'
|
||||
__author__ = 'Gabriele Marini, based on Darko Miletic'
|
||||
__copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||
description = 'Italian daily newspaper - 19-04-2010'
|
||||
|
||||
'''
|
||||
http://www.ilgiornale.it/
|
||||
'''
|
||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class IlGiornale(BasicNewsRecipe):
|
||||
__author__ = 'Marini Gabriele'
|
||||
description = 'Italian daily newspaper'
|
||||
|
||||
cover_url = 'http://www.ilgiornale.it/img_v1/logo.gif'
|
||||
title = u'Il Giornale'
|
||||
publisher = 'Il Giornale ON-LINE S.r.l.'
|
||||
category = 'News, politics, culture, economy, general interest'
|
||||
|
||||
language = 'it'
|
||||
timefmt = '[%a, %d %b, %Y]'
|
||||
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 50
|
||||
use_embedded_content = False
|
||||
recursion = 100
|
||||
|
||||
no_stylesheets = True
|
||||
conversion_options = {'linearize_tables':True}
|
||||
remove_javascript = True
|
||||
|
||||
|
||||
def get_article_url(self, article):
|
||||
return article.get('guid', article.get('id', None))
|
||||
|
||||
def print_version(self, url):
|
||||
raw = self.browser.open(url).read()
|
||||
soup = BeautifulSoup(raw.decode('utf8', 'replace'))
|
||||
all_print_tags = soup.find('div', {'style':'float:left; width:35%;'})
|
||||
print_link = all_print_tags.contents[1]
|
||||
if all_print_tags is None:
|
||||
return url
|
||||
return print_link['href']
|
||||
|
||||
|
||||
feeds = [
|
||||
(u'Ultime Notizie',u'http://www.ilgiornale.it/?RSS=S'),
|
||||
(u'All\'Interno', u'http://www.ilgiornale.it/la_s.pic1?SID=8&RSS=S'),
|
||||
(u'Esteri', u'http://www.ilgiornale.it/la_s.pic1?SID=6&RSS=S'),
|
||||
(u'Economia', u'http://www.ilgiornale.it/la_s.pic1?SID=5&RSS=S'),
|
||||
(u'Cultura', u'http://www.ilgiornale.it/la_s.pic1?SID=4&RSS=S'),
|
||||
(u'Spettacoli', u'http://www.ilgiornale.it/la_s.pic1?SID=14&RSS=S'),
|
||||
(u'Sport', u'http://www.ilgiornale.it/la_s.pic1?SID=15&RSS=S'),
|
||||
(u'Tech&Web', u'http://www.ilgiornale.it/la_s.pic1?SID=35&RSS=S'),
|
||||
(u'Edizione di Roma', u'http://www.ilgiornale.it/roma.pic1?SID=13&RSS=S'),
|
||||
(u'Edizione di Milano', u'http://www.ilgiornale.it/milano.pic1?SID=9&RSS=S'),
|
||||
(u'Edizione di Genova', u'http://www.ilgiornale.it/genova.pic1?SID=7&RSS=S')
|
||||
]
|
Loading…
x
Reference in New Issue
Block a user