home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_3812 < prev    next >
Encoding:
Text File  |  2010-04-30  |  3.1 KB  |  72 lines

  1. #!/usr/bin/env  python
  2. __license__   = 'GPL v3'
  3. __author__    = 'Lorenzo Vigentini & Edwin van Maastrigt'
  4. __copyright__ = '2009, Lorenzo Vigentini <l.vigentini at gmail.com> and Edwin van Maastrigt <evanmaastrigt at gmail.com>'
  5. __description__ = 'Financial news daily paper - v1.02 (30, January 2010)'
  6.  
  7. '''
  8. http://www.ilsole24ore.com/
  9. '''
  10.  
  11. from calibre.web.feeds.news import BasicNewsRecipe
  12.  
  13.  
  14. class ilsole24Ore(BasicNewsRecipe):
  15.     author        = 'Lorenzo Vigentini & Edwin van Maastrigt'
  16.     description   = 'Financial news daily paper'
  17.  
  18.     cover_url      = 'http://www.ilsole24ore.com/img2007/print_header.gif'
  19.  
  20.     title          = u'il Sole 24 Ore New'
  21.     publisher      = 'italiaNews'
  22.     category       = 'News, finance, economy, politics'
  23.  
  24.     language       = 'it'
  25.     timefmt        = '[%a, %d %b, %Y]'
  26.  
  27.     oldest_article = 2
  28.     max_articles_per_feed = 50
  29.     use_embedded_content  = False
  30.  
  31.     remove_javascript     = True
  32.     no_stylesheets        = True
  33.  
  34.     def get_article_url(self, article):
  35.         return article.get('id', article.get('guid', None))
  36.  
  37.     def print_version(self, url):
  38.         link, sep, params = url.rpartition('?')
  39.         if link  is None:
  40.            return link.replace('_1.php', '_php')
  41.         return link.replace('.shtml', '_PRN.shtml')
  42.  
  43.     keep_only_tags     = [
  44.                             dict(name='div', attrs={'class':'txt'})
  45.                         ]
  46. #    remove_tags = [dict(name='br')]
  47.  
  48.     feeds          = [
  49.                        (u'Prima pagina', u'http://www.ilsole24ore.com/rss/primapagina.xml'),
  50.                        (u'Norme e tributi', u'http://www.ilsole24ore.com/rss/norme-tributi.xml'),
  51.                        (u'Finanza e mercati', u'http://www.ilsole24ore.com/rss/finanza-mercati.xml'),
  52.                        (u'Economia e lavoro', u'http://www.ilsole24ore.com/rss/economia-lavoro.xml'),
  53.                        (u'Italia', u'http://www.ilsole24ore.com/rss/italia.xml'),
  54.                        (u'Mondo', u'http://www.ilsole24ore.com/rss/mondo.xml'),
  55.                        (u'Tecnologia e business', u'http://www.ilsole24ore.com/rss/tecnologia-business.xml'),
  56.                        (u'Cultura e tempo libero', u'http://www.ilsole24ore.com/rss/tempolibero-cultura.xml'),
  57.                        (u'Sport', u'http://www.ilsole24ore.com/rss/sport.xml'),
  58.                        (u'Professionisti 24', u'http://www.ilsole24ore.com/rss/prof_home.xml'),
  59.                        (u'Ambiente e Sicurezza',u'http://www.ilsole24ore.com/rss/prof_as.xml')
  60.                      ]
  61.  
  62.     extra_css = '''
  63.                 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:"Georgia","Times New Roman";}
  64.                 .linkHighlight {color:#0292c6;}
  65.                 .txt {border-bottom:1px solid #7c7c7c;padding-bottom:20px};text-align:justify;font-family:"serif"}
  66.                 .txt p {line-height:18px;}
  67.                 .txt span {line-height:22px;}
  68.                 .title h3 {color:#7b7b7b;}
  69.                 .title h4 {color:#08526e;font-size:26px;font-family:"Times New Roman";font-weight:normal;}
  70.                 '''
  71.  
  72.