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 Vigentini  and Edwin van Maastrigt '
__description__ = 'Financial news daily paper - v1.02 (30, January 2010)'


from 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      = ''
    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''),
                       (u'Norme e tributi', u''),
                       (u'Finanza e mercati', u''),
                       (u'Economia e lavoro', u''),
                       (u'Italia', u''),
                       (u'Mondo', u''),
                       (u'Tecnologia e business', u''),
                       (u'Cultura e tempo libero', u''),
                       (u'Sport', u''),
                       (u'Professionisti 24', u'')

    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

Be Sociable, Share!
Calibre Recipe: il Sole24ore
Tagged on: