home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_4267 < prev    next >
Encoding:
Text File  |  2010-10-28  |  3.1 KB  |  67 lines

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. perfil.com
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class Perfil(BasicNewsRecipe):
  10.     title                 = 'Perfil'
  11.     __author__            = 'Darko Miletic'
  12.     description           = 'Noticias de Argentina y el resto del mundo'
  13.     publisher             = 'perfil.com'
  14.     category              = 'news, politics, Argentina'
  15.     oldest_article        = 2
  16.     max_articles_per_feed = 200
  17.     no_stylesheets        = True
  18.     encoding              = 'cp1252'
  19.     use_embedded_content  = False
  20.     language              = 'es'
  21.     remove_empty_feeds    = True
  22.     masthead_url          = 'http://www.perfil.com/export/sites/diarioperfil/arte/10/logo_perfilcom_mm.gif'
  23.     extra_css             = """
  24.                                 body{font-family: Arial,Helvetica,sans-serif }
  25.                                 .seccion{border-bottom: 1px dotted #666666; text-transform: uppercase; font-size: x-large}
  26.                                 .foto1 h1{font-size: x-small}
  27.                                 h1{font-family: Georgia,"Times New Roman",serif}
  28.                                 img{margin-bottom: 0.4em}
  29.                             """
  30.  
  31.     conversion_options = {
  32.                           'comment'   : description
  33.                         , 'tags'      : category
  34.                         , 'publisher' : publisher
  35.                         , 'language'  : language
  36.                         }
  37.  
  38.     remove_tags   = [
  39.                       dict(name=['iframe','embed','object','base','meta','link'])
  40.                      ,dict(name='a', attrs={'href':'#comentarios'})
  41.                      ,dict(name='div', attrs={'class':'foto3'})
  42.                      ,dict(name='img', attrs={'alt':'ampliar'})
  43.                     ]
  44.     keep_only_tags=[dict(attrs={'class':['bd468a','cuerpoSuperior']})]
  45.     remove_attributes=['onload','lang','width','height','border']
  46.  
  47.     feeds = [
  48.               (u'Ultimo momento' , u'http://www.perfil.com/rss/ultimomomento.xml')
  49.              ,(u'Politica'       , u'http://www.perfil.com/rss/politica.xml'     )
  50.              ,(u'Policia'        , u'http://www.perfil.com/rss/policia.xml'      )
  51.              ,(u'Internacionales', u'http://www.perfil.com/rss/internacional.xml')
  52.              ,(u'Economia'       , u'http://www.perfil.com/rss/economia.xml'     )
  53.              ,(u'Deportes'       , u'http://www.perfil.com/rss/deportes.xml'     )
  54.              ,(u'Opinion'        , u'http://www.perfil.com/rss/columnistas.xml'  )
  55.              ,(u'Sociedad'       , u'http://www.perfil.com/rss/sociedad.xml'     )
  56.              ,(u'Cultura'        , u'http://www.perfil.com/rss/cultura.xml'      )
  57.              ,(u'Espectaculos'   , u'http://www.perfil.com/rss/espectaculos.xml' )
  58.              ,(u'Ciencia'        , u'http://www.perfil.com/rss/ciencia.xml'      )
  59.              ,(u'Salud'          , u'http://www.perfil.com/rss/salud.xml'        )
  60.              ,(u'Tecnologia'     , u'http://www.perfil.com/rss/tecnologia.xml'   )
  61.             ]
  62.  
  63.     def preprocess_html(self, soup):
  64.         for item in soup.findAll(style=True):
  65.             del item['style']
  66.         return soup
  67.