home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / Calibre / calibre-0.8.18.msi / file_280 / liberation.recipe < prev    next >
Text File  |  2011-09-09  |  2KB  |  48 lines

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
  5. '''
  6. liberation.fr
  7. '''
  8.  
  9. from calibre.web.feeds.news import BasicNewsRecipe
  10.  
  11. class Liberation(BasicNewsRecipe):
  12.     title                 = u'Liberation'
  13.     __author__            = 'Darko Miletic'
  14.     description           = 'News from France'
  15.     language = 'fr'
  16.  
  17.     oldest_article        = 7
  18.     max_articles_per_feed = 100
  19.     no_stylesheets        = True
  20.     use_embedded_content  = False
  21.  
  22.     html2lrf_options = ['--base-font-size', '10']
  23.  
  24.     keep_only_tags    = [
  25.                            dict(name='h1')
  26.                           #,dict(name='div', attrs={'class':'object-content text text-item'})
  27.                           ,dict(name='div', attrs={'class':'article'})
  28.                           #,dict(name='div', attrs={'class':'articleContent'})
  29.                           ,dict(name='div', attrs={'class':'entry'})
  30.                         ]
  31.     remove_tags_after = [ dict(name='div',attrs={'class':'toolbox extra_toolbox'}) ]
  32.     remove_tags    = [
  33.                         dict(name='p', attrs={'class':'clear'})
  34.                        ,dict(name='ul', attrs={'class':'floatLeft clear'})
  35.                        ,dict(name='div', attrs={'class':'clear floatRight'})
  36.                        ,dict(name='object')
  37.                        ,dict(name='div', attrs={'class':'toolbox'})
  38.                        ,dict(name='div', attrs={'class':'cartridge cartridge-basic-bubble cat-zoneabo'})
  39.                        #,dict(name='div', attrs={'class':'clear block block-call-items'})
  40.                        ,dict(name='div', attrs={'class':'block-content'})
  41.                      ]
  42.  
  43.     feeds          = [
  44.                          (u'La une', u'http://www.liberation.fr/rss/laune')
  45.                         ,(u'Monde' , u'http://www.liberation.fr/rss/monde')
  46.                         ,(u'Sports', u'http://www.liberation.fr/rss/sports')
  47.                      ]
  48.