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

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __author__ = '2010, Gustavo Azambuja <hola at gazambuja.com>'
  5. '''
  6. ladiaria.com.uy
  7. '''
  8.  
  9. from calibre.web.feeds.news import BasicNewsRecipe
  10.  
  11. class General(BasicNewsRecipe):
  12.     title                 = 'La Diaria'
  13.     __author__            = 'Gustavo Azambuja'
  14.     description           = 'Noticias de Uruguay'
  15.     language       = 'es_UY'
  16.     timefmt        = '[%a, %d %b, %Y]'
  17.     use_embedded_content  = False
  18.     recursion             = 5
  19.     encoding = 'utf8'
  20.     remove_javascript = True
  21.     no_stylesheets = True
  22.  
  23.     oldest_article        = 2
  24.     max_articles_per_feed = 100
  25.     keep_only_tags = [dict(id=['article'])]
  26.     remove_tags = [
  27.              dict(name='div', attrs={'class':['byline', 'hr', 'titlebar', 'volver-arriba-right']}),
  28.              dict(name='div', attrs={'id':'discussion'}),
  29.              dict(name=['object','link'])
  30.                   ]
  31.  
  32.     extra_css = '''
  33.                 h1{font-family:Geneva, Arial, Helvetica, sans-serif;color:#154B7A;}
  34.                 h3{font-size: 14px;color:#999999; font-family:Geneva, Arial, Helvetica, sans-serif;font-weight: bold;}
  35.                 h2{color:#666666; font-family:Geneva, Arial, Helvetica, sans-serif;font-size:small;}
  36.                 p {font-family:Arial,Helvetica,sans-serif;}
  37.                 '''
  38.     feeds = [
  39.            (u'Articulos', u'http://ladiaria.com/feeds/articulos')
  40.         ]
  41.  
  42.     def get_cover_url(self):
  43.         return 'http://ladiaria.com/edicion/imagenportada/'
  44.  
  45.     def preprocess_html(self, soup):
  46.         for item in soup.findAll(style=True):
  47.             del item['style']
  48.         return soup
  49.