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

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
  5. '''
  6. juventudrebelde.co.cu
  7. '''
  8.  
  9. from calibre.web.feeds.news import BasicNewsRecipe
  10.  
  11. class Juventudrebelde_english(BasicNewsRecipe):
  12.     title                 = 'Juventud Rebelde in english'
  13.     __author__            = 'Darko Miletic'
  14.     description           = 'The newspaper of Cuban Youth'
  15.     publisher             = 'Juventud Rebelde'
  16.     category              = 'news, politics, Cuba'
  17.     oldest_article        = 2
  18.     max_articles_per_feed = 100
  19.     no_stylesheets        = True
  20.     use_embedded_content  = False
  21.     encoding              = 'iso-8859-1'
  22.     remove_javascript     = True
  23.  
  24.     html2lrf_options = [
  25.                           '--comment', description
  26.                         , '--category', category
  27.                         , '--publisher', publisher
  28.                         , '--ignore-tables'
  29.                         ]
  30.  
  31.     html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
  32.  
  33.     keep_only_tags = [dict(name='div', attrs={'class':'read'})]
  34.  
  35.     feeds = [(u'All news', u'http://www.juventudrebelde.cip.cu/rss/all/' )]
  36.  
  37.     def preprocess_html(self, soup):
  38.         mtag = '<meta http-equiv="Content-Language" content="es-CU"/>'
  39.         soup.head.insert(0,mtag)
  40.         for item in soup.findAll(style=True):
  41.             del item['style']
  42.         return soup
  43.  
  44.     language = 'en'
  45.