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

  1. import re
  2. from calibre.web.feeds.news import BasicNewsRecipe
  3.  
  4. class PortalR7(BasicNewsRecipe):
  5.     title                  = 'Noticias R7'
  6.     __author__             = 'Diniz Bortolotto'
  7.     description            = 'Noticias Portal R7'
  8.     oldest_article         = 2
  9.     max_articles_per_feed  = 20
  10.     encoding               = 'utf8'
  11.     publisher              = 'Rede Record'
  12.     category               = 'news, Brazil'
  13.     language               = 'pt_BR'
  14.     publication_type       = 'newsportal'
  15.     use_embedded_content   = False
  16.     no_stylesheets         = True
  17.     remove_javascript      = True
  18.     remove_attributes      = ['style']
  19.  
  20.     feeds                  = [
  21.                               (u'Brasil', u'http://www.r7.com/data/rss/brasil.xml'),
  22.                               (u'Economia', u'http://www.r7.com/data/rss/economia.xml'),
  23.                               (u'Internacional', u'http://www.r7.com/data/rss/internacional.xml'),
  24.                               (u'Tecnologia e Ci\xeancia', u'http://www.r7.com/data/rss/tecnologiaCiencia.xml')
  25.                              ]
  26.     reverse_article_order  = True
  27.  
  28.     keep_only_tags         = [dict(name='div', attrs={'class':'materia'})]
  29.     remove_tags            = [
  30.                               dict(id=['espalhe', 'report-erro']),
  31.                               dict(name='ul', attrs={'class':'controles'}),
  32.                               dict(name='ul', attrs={'class':'relacionados'}),
  33.                               dict(name='div', attrs={'class':'materia_banner'}),
  34.                               dict(name='div', attrs={'class':'materia_controles'})
  35.                              ]
  36.  
  37.     preprocess_regexps     = [
  38.                               (re.compile(r'<div class="materia">.*<div class="materia_cabecalho">',re.DOTALL|re.IGNORECASE),
  39.                               lambda match: '<div class="materia"><div class="materia_cabecalho">')
  40.                              ]
  41.