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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. abc.com.py
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class ABC_py(BasicNewsRecipe):
  10.     title                 = 'ABC digital'
  11.     __author__            = 'Darko Miletic'
  12.     description           = 'Noticias de Paraguay y el resto del mundo'
  13.     publisher             = 'ABC'
  14.     category              = 'news, politics, Paraguay'
  15.     oldest_article        = 2
  16.     max_articles_per_feed = 200
  17.     no_stylesheets        = True
  18.     encoding              = 'cp1252'
  19.     use_embedded_content  = False
  20.     language              = 'es_PY'
  21.     remove_empty_feeds    = True
  22.     publication_type      = 'newspaper'
  23.     extra_css             = ' body{font-family: Arial,Helvetica,sans-serif } img{margin-bottom: 0.4em} '
  24.  
  25.     conversion_options = {
  26.                           'comment'   : description
  27.                         , 'tags'      : category
  28.                         , 'publisher' : publisher
  29.                         , 'language'  : language
  30.                         }
  31.  
  32.     remove_tags       = [dict(name=['form','iframe','embed','object','link','base','table']),dict(attrs={'class':'toolbox'})]
  33.     remove_tags_after = dict(attrs={'class':'date'})
  34.     keep_only_tags    = [dict(attrs={'class':'zcontent'})]
  35.  
  36.  
  37.     feeds = [
  38.                (u'Ultimo momento'      , u'http://www.abc.com.py/ultimo-momento.xml'      )
  39.               ,(u'Nacionales'          , u'http://www.abc.com.py/nacionales.xml'          )
  40.               ,(u'Internacionales'     , u'http://www.abc.com.py/internacionales.xml'     )
  41.               ,(u'Deportes'            , u'http://www.abc.com.py/deportes.xml'            )
  42.               ,(u'Espectaculos'        , u'http://www.abc.com.py/espectaculos.xml'        )
  43.               ,(u'Ciencia y Tecnologia', u'http://www.abc.com.py/ciencia-y-tecnologia.xml')
  44.             ]
  45.  
  46.     def preprocess_html(self, soup):
  47.         for item in soup.findAll(style=True):
  48.             del item['style']
  49.         return soup
  50.