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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. www.lostiempos.com
  5. '''
  6.  
  7. from calibre import strftime
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class LosTiempos_Bol(BasicNewsRecipe):
  11.     title                 = 'Los Tiempos - Bolivia'
  12.     __author__            = 'Darko Miletic'
  13.     description           = 'El peri├│dico de mayor circulaci├│n en la ciudad de Cochabamba, Bolivia'
  14.     publisher             = 'Los Tiempos'
  15.     category              = 'news, politics, Bolivia'
  16.     oldest_article        = 1
  17.     max_articles_per_feed = 200
  18.     no_stylesheets        = True
  19.     encoding              = 'cp1252'
  20.     use_embedded_content  = False
  21.     language              = 'es_BO'
  22.     publication_type      = 'newspaper'
  23.     delay                 = 1
  24.     remove_empty_feeds    = True
  25.     cover_url             = strftime('http://www.lostiempos.com/media_recortes/%Y/%m/%d/portada_md_1.jpg')
  26.     masthead_url          = 'http://www.lostiempos.com/img_stat/logo_tiempos_sin_beta.jpg'
  27.     extra_css             = """ body{font-family: Arial,Helvetica,sans-serif }
  28.                                 img{margin-bottom: 0.4em}
  29.                                 h1,.hora,.breadcum,.pie_foto{font-family: Georgia,"Times New Roman",Times,serif}
  30.                                 .hora,.breadcum,.pie_foto{font-size: small}
  31.                                 .en_gris,.pie_foto{color: #666666}
  32.                                 """
  33.  
  34.     conversion_options = {
  35.                           'comment'   : description
  36.                         , 'tags'      : category
  37.                         , 'publisher' : publisher
  38.                         , 'language'  : language
  39.                         }
  40.  
  41.     keep_only_tags    = [dict(name='div', attrs={'id':'articulo'})]
  42.     remove_tags       = [
  43.                           dict(name=['meta','link','form','iframe','embed','object','hr'])
  44.                          ,dict(attrs={'class':['caja_fonts sin_border_bot','pub']})
  45.                         ]
  46.     remove_attributes = ['width','height']
  47.  
  48.     feeds = [
  49.               (u'Nacional'       , u'http://www.lostiempos.com/rss/lostiempos-nacional.xml'       )
  50.              ,(u'Local'          , u'http://www.lostiempos.com/rss/lostiempos-local.xml'          )
  51.              ,(u'Deportes'       , u'http://www.lostiempos.com/rss/lostiempos-deportes.xml'       )
  52.              ,(u'Econom├¡a'       , u'http://www.lostiempos.com/rss/lostiempos-economia.xml'       )
  53.              ,(u'Internacional'  , u'http://www.lostiempos.com/rss/lostiempos-internacional.xml'  )
  54.              ,(u'Vida y Futuro'  , u'http://www.lostiempos.com/rss/lostiempos-vida-y-futuro.xml'  )
  55.              ,(u'Tragaluz'       , u'http://www.lostiempos.com/rss/lostiempos-tragaluz.xml'       )
  56.              ,(u'Opiniones'      , u'http://www.lostiempos.com/rss/lostiempos-opiniones.xml'      )
  57.             ]
  58.  
  59.     def preprocess_html(self, soup):
  60.         for item in soup.findAll(style=True):
  61.             del item['style']
  62.         return soup
  63.  
  64.