home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_4085 < prev    next >
Encoding:
Text File  |  2010-09-30  |  2.1 KB  |  57 lines

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2008-2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. infobae.com
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class Infobae(BasicNewsRecipe):
  10.     title                 = 'Infobae.com'
  11.     __author__            = 'Darko Miletic and Sujata Raman'
  12.     description           = 'Informacion Libre las 24 horas'
  13.     publisher             = 'Infobae.com'
  14.     category              = 'news, politics, Argentina'
  15.     oldest_article        = 1
  16.     max_articles_per_feed = 100
  17.     no_stylesheets        = True
  18.     use_embedded_content  = False
  19.     language              = 'es'
  20.     encoding              = 'cp1252'
  21.     masthead_url          = 'http://www.infobae.com/imgs/header/header.gif'
  22.     remove_javascript     = True
  23.     remove_empty_feeds    = True
  24.     extra_css             = '''
  25.                               body{font-family:Arial,Helvetica,sans-serif;}
  26.                               .popUpTitulo{color:#0D4261; font-size: xx-large}
  27.                             '''
  28.     
  29.     conversion_options = {
  30.                           'comment'          : description
  31.                         , 'tags'             : category
  32.                         , 'publisher'        : publisher
  33.                         , 'language'         : language
  34.                         , 'linearize_tables' : True
  35.                         }
  36.     
  37.  
  38.     feeds = [
  39.               (u'Noticias'  , u'http://www.infobae.com/adjuntos/html/RSS/hoy.xml'       )
  40.              ,(u'Salud'     , u'http://www.infobae.com/adjuntos/html/RSS/salud.xml'     )
  41.              ,(u'Tecnologia', u'http://www.infobae.com/adjuntos/html/RSS/tecnologia.xml')
  42.              ,(u'Deportes'  , u'http://www.infobae.com/adjuntos/html/RSS/deportes.xml'  )
  43.             ]
  44.  
  45.     def print_version(self, url):
  46.         article_part = url.rpartition('/')[2]
  47.         article_id= article_part.partition('-')[0]
  48.         return 'http://www.infobae.com/notas/nota_imprimir.php?Idx=' + article_id
  49.  
  50.     def postprocess_html(self, soup, first):
  51.         for tag in soup.findAll(name='strong'):
  52.              tag.name = 'b'
  53.         return soup
  54.  
  55.  
  56.  
  57.