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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. eluniverso.com
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class ElUniverso_Ecuador(BasicNewsRecipe):
  10.     title                 = 'El Universo - Ecuador'
  11.     __author__            = 'Darko Miletic'
  12.     description           = 'Noticias del Ecuador y el resto del mundo'
  13.     publisher             = 'El Universo'
  14.     category              = 'news, politics, Ecuador'
  15.     oldest_article        = 2
  16.     max_articles_per_feed = 200
  17.     no_stylesheets        = True
  18.     encoding              = 'utf8'
  19.     use_embedded_content  = False
  20.     language              = 'es_EC'
  21.     remove_empty_feeds    = True
  22.     publication_type      = 'newspaper'
  23.     masthead_url          = 'http://servicios2.eluniverso.com/versiones/v1/img/Hd/lg_ElUniverso.gif'
  24.     extra_css             = """
  25.                                 body{font-family: Verdana,Arial,Helvetica,sans-serif; color: #333333 }
  26.                                 h2{font-family: Georgia,"Times New Roman",Times,serif; color: #1B2D60}
  27.                             """
  28.  
  29.     conversion_options = {
  30.                           'comment'   : description
  31.                         , 'tags'      : category
  32.                         , 'publisher' : publisher
  33.                         , 'language'  : language
  34.                         }
  35.  
  36.     remove_tags        = [
  37.                             dict(attrs={'class':['flechs','multiBox','colRecursos']})
  38.                            ,dict(name=['meta','link','embed','object','iframe','base'])
  39.                          ]
  40.     keep_only_tags     = [dict(attrs={'class':'Nota'})]
  41.     remove_tags_after  = dict(attrs={'id':'TextoPrint'})
  42.     remove_tags_before = dict(attrs={'id':'FechaPrint'})
  43.  
  44.     feeds = [
  45.               (u'Portada'          , u'http://www.eluniverso.com/rss/portada.xml'           )
  46.              ,(u'Politica'         , u'http://www.eluniverso.com/rss/politica.xml'          )
  47.              ,(u'Economia'         , u'http://www.eluniverso.com/rss/economia.xml'          )
  48.              ,(u'Sucesos'          , u'http://www.eluniverso.com/rss/sucesos.xml'           )
  49.              ,(u'Migracion'        , u'http://www.eluniverso.com/rss/migrantes_tema.xml'    )
  50.              ,(u'El Pais'          , u'http://www.eluniverso.com/rss/elpais.xml'            )
  51.              ,(u'Internacionales'  , u'http://www.eluniverso.com/rss/internacionales.xml'   )
  52.              ,(u'Deportes'         , u'http://www.eluniverso.com/rss/deportes.xml'          )
  53.              ,(u'Gran Guayaquill'  , u'http://www.eluniverso.com/rss/gran_guayaquil.xml'    )
  54.              ,(u'Entretenimiento'  , u'http://www.eluniverso.com/rss/arteyespectaculos.xml' )
  55.              ,(u'Vida'             , u'http://www.eluniverso.com/rss/tuvida.xml'            )
  56.              ,(u'Opinion'          , u'http://www.eluniverso.com/rss/opinion.xml'           )
  57.             ]
  58.  
  59.     def preprocess_html(self, soup):
  60.         for item in soup.findAll(style=True):
  61.             del item['style']
  62.         return soup
  63.  
  64.