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_cuarta.recipe < prev    next >
Encoding:
Text File  |  2011-09-09  |  1.9 KB  |  54 lines

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
  5. '''
  6. lacuarta.cl
  7. '''
  8.  
  9. from calibre.web.feeds.news import BasicNewsRecipe
  10.  
  11. class LaCuarta(BasicNewsRecipe):
  12.     title                 = 'La Cuarta'
  13.     __author__            = 'Darko Miletic'
  14.     description           = 'La Cuarta Cibernetica: El Diario popular'
  15.     publisher             = 'CODISA, Consorcio Digital S.A.'
  16.     category              = 'news, politics, entertainment, Chile'
  17.     oldest_article        = 2
  18.     max_articles_per_feed = 100
  19.     no_stylesheets        = True
  20.     use_embedded_content  = False
  21.     encoding              = 'cp1252'
  22.     remove_javascript     = True
  23.  
  24.     html2lrf_options = [
  25.                           '--comment', description
  26.                         , '--category', category
  27.                         , '--publisher', publisher
  28.                         ]
  29.  
  30.     html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
  31.  
  32.     keep_only_tags = [dict(name='div', attrs={'class':'articulo desplegado'}) ]
  33.  
  34.     remove_tags = [
  35.                      dict(name='ul')
  36.                     ,dict(name='div', attrs={'id':['toolbox','articleImageDisplayer','enviarAmigo']})
  37.                     ,dict(name='div', attrs={'class':['par ad-1','par ad-2']})
  38.                     ,dict(name='input')
  39.                     ,dict(name='p', attrs={'id':['mensajeError','mensajeEnviandoNoticia','mensajeExito']})
  40.                     ,dict(name='strong', text='PUBLICIDAD')
  41.                   ]
  42.  
  43.     def preprocess_html(self, soup):
  44.         mtag = '<meta http-equiv="Content-Language" content="es-CL"/>'
  45.         soup.head.insert(0,mtag)
  46.         for item in soup.findAll(style=True):
  47.             del item['style']
  48.         return soup
  49.  
  50.     feeds = [(u'Noticias', u'http://lacuarta.cl/app/rss?sc=TEFDVUFSVEE=')]
  51.  
  52.  
  53.     language = 'es_CL'
  54.