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

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __author__ = '2010, Gustavo Azambuja <hola at gazambuja.com>'
  5. '''
  6. 180.com.uy
  7. '''
  8.  
  9. from calibre.web.feeds.news import BasicNewsRecipe
  10.  
  11. class Noticias(BasicNewsRecipe):
  12.     title                 = '180.com.uy'
  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 = 'utf-8'
  20.     remove_javascript = True
  21.     no_stylesheets = True
  22.  
  23.     oldest_article        = 2
  24.     max_articles_per_feed = 100
  25.     keep_only_tags = [dict(name='div', attrs={'class':'tef-md tef-md-seccion-sociedad'})]
  26.     remove_tags = [
  27.              dict(name=['object','link'])
  28.                   ]
  29.  
  30.     remove_attributes = ['width','height', 'style', 'font', 'color']
  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'Titulares', u'http://www.180.com.uy/feed.php')
  40.         ]
  41.  
  42.     def get_cover_url(self):
  43.         return 'http://www.180.com.uy/tplef/img/logo.gif'
  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.