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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2009-2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. emol.com
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class ElMercurio(BasicNewsRecipe):
  10.     title                 = 'El Mercurio online'
  11.     __author__            = 'Darko Miletic'
  12.     description           = 'El sitio de noticias online de Chile'
  13.     publisher             = 'El Mercurio'
  14.     category              = 'news, politics, Chile'
  15.     oldest_article        = 2
  16.     max_articles_per_feed = 100
  17.     no_stylesheets        = True
  18.     use_embedded_content  = False
  19.     encoding              = 'cp1252'
  20.     masthead_url          = 'http://www.emol.com/especiales/logo_emol/logo_emol.gif'
  21.     remove_javascript     = True
  22.     use_embedded_content  = False
  23.     language              = 'es_CL'
  24.  
  25.  
  26.     conversion_options = {
  27.                           'comment'   : description
  28.                         , 'tags'      : category
  29.                         , 'publisher' : publisher
  30.                         , 'language'  : language
  31.                         }
  32.  
  33.     keep_only_tags = [dict(name='div', attrs={'id':['cont_iz_titulobajada','cont_iz_creditos_1_a','cont_iz_cuerpo']})]
  34.     remove_tags = [dict(name='div', attrs={'id':'cont_iz_cuerpo_relacionados'})]
  35.     remove_attributes = ['height','width']
  36.  
  37.     feeds = [
  38.                (u'Noticias de ultima hora', u'http://rss.emol.com/rss.asp?canal=0')
  39.               ,(u'Nacional', u'http://rss.emol.com/rss.asp?canal=1')
  40.               ,(u'Mundo', u'http://rss.emol.com/rss.asp?canal=2')
  41.               ,(u'Deportes', u'http://rss.emol.com/rss.asp?canal=4')
  42.               ,(u'Magazine', u'http://rss.emol.com/rss.asp?canal=6')
  43.               ,(u'Tecnologia', u'http://rss.emol.com/rss.asp?canal=5')
  44.             ]
  45.  
  46.     def preprocess_html(self, soup):
  47.         for item in soup.findAll(style=True):
  48.             del item['style']
  49.         return soup
  50.  
  51.