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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. rusiahoy.com
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class RusiaHoy(BasicNewsRecipe):
  10.     title                 = 'Rusia Hoy'
  11.     __author__            = 'Darko Miletic'
  12.     description           = 'Noticias de Russia en castellano'
  13.     publisher             = 'rusiahoy.com'
  14.     category              = 'news, politics, Russia'
  15.     oldest_article        = 7
  16.     max_articles_per_feed = 200
  17.     no_stylesheets        = True
  18.     encoding              = 'utf8'
  19.     use_embedded_content  = False
  20.     language              = 'es'
  21.     remove_empty_feeds    = True
  22.     extra_css             = """
  23.                                 body{font-family: Arial,sans-serif }
  24.                                 .article_article_title{font-size: xx-large; font-weight: bold}
  25.                                 .article_date{color: black; font-size: small}
  26.                             """
  27.  
  28.     conversion_options = {
  29.                           'comment'   : description
  30.                         , 'tags'      : category
  31.                         , 'publisher' : publisher
  32.                         , 'language'  : language
  33.                         }
  34.  
  35.     remove_tags = [dict(name=['meta','link','iframe','base','object','embed'])]
  36.     keep_only_tags=[  dict(attrs={'class':['article_rubric_title','article_date','article_article_title','article_article_lead']})
  37.                      ,dict(attrs={'class':'article_article_text'})
  38.                    ]
  39.     remove_attributes=['align','width','height']
  40.  
  41.     feeds = [(u'Articulos', u'http://rusiahoy.com/xml/index.xml')]
  42.  
  43.     def preprocess_html(self, soup):
  44.         for item in soup.findAll(style=True):
  45.             del item['style']
  46.         return soup
  47.  
  48.