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

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
  5. '''
  6. jbonline.terra.com.br
  7. '''
  8.  
  9. from calibre.web.feeds.news import BasicNewsRecipe
  10.  
  11. class JBOnline(BasicNewsRecipe):
  12.     title                 = 'Jornal Brasileiro Online'
  13.     __author__            = 'Darko Miletic'
  14.     description           = 'News from Brasil'
  15.     publisher             = 'Jornal Brasileiro'
  16.     category              = 'news, politics, Brasil'
  17.     oldest_article        = 2
  18.     max_articles_per_feed = 100
  19.     no_stylesheets        = True
  20.     use_embedded_content  = False
  21.     encoding              = 'cp1252'
  22.     cover_url             = 'http://jbonline.terra.com.br/img/logo_01.gif'
  23.     remove_javascript     = True
  24.  
  25.     html2lrf_options = [
  26.                           '--comment', description
  27.                         , '--category', category
  28.                         , '--publisher', publisher
  29.                         ]
  30.  
  31.     html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
  32.  
  33.     keep_only_tags = [dict(name='div', attrs={'id':'corpoNoticia'})]
  34.  
  35.     remove_tags = [dict(name=['script','object','form'])]
  36.  
  37.     feeds = [(u'Todos as editorias', u'http://jbonline.terra.com.br/extra/rsstrjb.xml')]
  38.  
  39.     def preprocess_html(self, soup):
  40.         ifr = soup.find('iframe')
  41.         if ifr:
  42.            ifr.extract()
  43.         for item in soup.findAll(style=True):
  44.             del item['style']
  45.         return soup
  46.  
  47.     language = 'pt'
  48.  
  49.