Today’s Calibre Recipe is: ‘il Sole24ore ‘
il Sole, printed on a orangey paper similar to the FT, is the most popular daily newspaper in Italy dedicate mainly to economy and finance and it is the third most diffused paper in Italy after the il Corriere della sera and la Repubblica
Click here to view the code
#!/usr/bin/env python __license__ = 'GPL v3' __author__ = 'Lorenzo Vigentini & Edwin van Maastrigt' __copyright__ = '2009, Lorenzo Vigentiniand Edwin van Maastrigt ' __description__ = 'Financial news daily paper - v1.02 (30, January 2010)' ''' http://www.ilsole24ore.com/ ''' from calibre.web.feeds.news import BasicNewsRecipe from calibre.ptempfile import PersistentTemporaryFile import mechanize temp_files = [] class ilsole(BasicNewsRecipe): author = 'Lorenzo Vigentini & Edwin van Maastrigt' description = 'Financial news daily paper - v1.02 (30, January 2010)' cover_url = 'http://www.ilsole24ore.com/img2009/header/t_logosole.gif' title = u'il Sole 24 Ore ' publisher = 'italiaNews' category = 'News, finance, economy, politics' language = 'it' timefmt = '[%a, %d %b, %Y]' oldest_article = 2 max_articles_per_feed = 50 use_embedded_content = False remove_javascript = True no_stylesheets = True def get_article_url(self, article): return article.get('id', article.get('guid', None)) def print_version(self, url): link, sep, params = url.rpartition('?') return link.replace('.shtml', '_PRN.shtml') keep_only_tags = [ dict(name='div', attrs={'class':'txt'}) ] remove_tags = [dict(name='br')] feeds = [ (u'Prima pagina', u'http://www.ilsole24ore.com/rss/primapagina.xml'), (u'Norme e tributi', u'http://www.ilsole24ore.com/rss/norme-tributi.xml'), (u'Finanza e mercati', u'http://www.ilsole24ore.com/rss/finanza-mercati.xml'), (u'Economia e lavoro', u'http://www.ilsole24ore.com/rss/economia-lavoro.xml'), (u'Italia', u'http://www.ilsole24ore.com/rss/italia.xml'), (u'Mondo', u'http://www.ilsole24ore.com/rss/mondo.xml'), (u'Tecnologia e business', u'http://www.ilsole24ore.com/rss/tecnologia-business.xml'), (u'Cultura e tempo libero', u'http://www.ilsole24ore.com/rss/tempolibero-cultura.xml'), (u'Sport', u'http://www.ilsole24ore.com/rss/sport.xml'), (u'Professionisti 24', u'http://www.ilsole24ore.com/rss/prof_home.xml') ] extra_css = ''' html, body, table, tr, td, h1, h2, h3, h4, h5, h6, p, a, span, br, img {margin:0;padding:0;border:0;font-size:12px;font-family:Arial;} .linkHighlight {color:#0292c6;} .txt {border-bottom:1px solid #7c7c7c;padding-bottom:20px;text-align:justify;} .txt p {line-height:18px;} .txt span {line-height:22px;} .title h3 {color:#7b7b7b;} .title h4 {color:#08526e;font-size:26px;font-family:"Times New Roman";font-weight:normal;} '''
Download the file here: Calibre recipe: il sole24ore