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

  1. from calibre.web.feeds.news import BasicNewsRecipe
  2.  
  3. class DiarioSport(BasicNewsRecipe):
  4.     title          = u'Diario Sport'
  5.     oldest_article = 2
  6.     max_articles_per_feed = 75
  7.     __author__  = 'Jefferson Frantz'
  8.     description = 'Todas las noticias del Bar├ºa y del mundo del deporte en general'
  9.     timefmt = ' [%d %b, %Y]'
  10.     language = 'es'
  11.     no_stylesheets = True
  12.  
  13.     feeds          = [(u'Sport', u'http://feeds.feedburner.com/sport/ultimahora')]
  14.  
  15.     extra_css              = '''
  16.                                 h2{font-family: serif; font-size: small; font-weight: bold; color: #000000; text-align: justify}
  17.                                 '''
  18.  
  19.     keep_only_tags = [dict(name='div', attrs={'id':['noticiasMedio']})]
  20.  
  21.     remove_tags        = [
  22.                              dict(name=['object','link','script','ul'])
  23.                             ,dict(name='div', attrs={'id':['scrAdSense','herramientas2','participacion','participacion2','bloque1resultados','bloque2resultados','cont_vinyetesAnt','tinta','noticiasSuperior','cintillopublicidad2']})
  24.                             ,dict(name='p', attrs={'class':['masinformacion','hora']})
  25.                             ,dict(name='a', attrs={'class':["'link'"]})
  26.                             ,dict(name='div', attrs={'class':['addthis_toolbox addthis_default_style','firma','pretitularnoticia']})
  27.                             ,dict(name='form', attrs={'id':['formularioDeBusquedaAvanzada']})
  28.                          ]
  29.  
  30.     def preprocess_html(self, soup):
  31.             for item in soup.findAll(style=True):
  32.                del item['style']
  33.             return soup
  34.  
  35.  
  36.     def postprocess_html(self, soup, first_fetch):
  37.         img = soup.find('img',src='/img/videos/mascaravideo.png')
  38.         if not img is None:
  39.             img.extract()
  40.  
  41.         return soup
  42.  
  43.