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

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
  5. '''
  6. mondedurable.science-et-vie.com
  7. '''
  8.  
  9. from calibre.web.feeds.news import BasicNewsRecipe
  10.  
  11. class AdventureGamers(BasicNewsRecipe):
  12.     title                 = 'Monde durable'
  13.     language = 'fr'
  14.  
  15.     __author__            = 'Darko Miletic'
  16.     description           = 'science news'    
  17.     publisher             = 'Monde durable'
  18.     category              = 'environnement, developpement durable, science & vie, science et vie'    
  19.     oldest_article        = 30
  20.     delay                 = 2
  21.     max_articles_per_feed = 100
  22.     no_stylesheets        = True
  23.     encoding              = 'utf-8'
  24.     remove_javascript     = True
  25.     use_embedded_content  = False
  26.     
  27.     html2lrf_options = [
  28.                           '--comment', description
  29.                         , '--category', category
  30.                         , '--publisher', publisher
  31.                         ]
  32.     
  33.     html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"' 
  34.  
  35.     keep_only_tags = [dict(name='div', attrs={'class':'post'})]
  36.  
  37.     remove_tags = [dict(name=['object','link','embed','form','img'])]
  38.                   
  39.     feeds = [(u'Articles', u'http://mondedurable.science-et-vie.com/feed/')]
  40.     
  41.     def preprocess_html(self, soup):
  42.         mtag = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>'
  43.         soup.head.insert(0,mtag)    
  44.         for item in soup.findAll(style=True):
  45.             del item['style']
  46.         return soup
  47.