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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. www.chinadaily.com.cn
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class Pagina12(BasicNewsRecipe):
  10.     title                 = 'China Daily'
  11.     __author__            = 'Darko Miletic'
  12.     description           = 'Chinadaily.com.cn is the largest English portal in China, providing news, business information, BBS, learning materials.'
  13.     publisher             = 'China Daily Information Co.'
  14.     category              = 'news, politics, China'
  15.     oldest_article        = 2
  16.     max_articles_per_feed = 200
  17.     no_stylesheets        = True
  18.     encoding              = 'utf8'
  19.     use_embedded_content  = False
  20.     language              = 'en_CN'
  21.     remove_empty_feeds    = True
  22.     publication_type      = 'newsportal'
  23.     masthead_url          = 'http://www.chinadaily.com.cn/15421.files/chinadailylogo_e_20100301.jpg'
  24.     extra_css             = ' body{font-family: Arial,Helvetica,sans-serif } '
  25.  
  26.     conversion_options = {
  27.                           'comment'   : description
  28.                         , 'tags'      : category
  29.                         , 'publisher' : publisher
  30.                         , 'language'  : language
  31.                         }
  32.  
  33.     remove_tags = [dict(name=['object','embed','iframe','table'])]
  34.     keep_only_tags = [dict(attrs={'id':['Title_e','Content']})]
  35.  
  36.  
  37.     feeds = [
  38.               (u'China'   , u'http://www.chinadaily.com.cn/rss/china_rss.xml'   )
  39.              ,(u'Business', u'http://www.chinadaily.com.cn/rss/bizchina_rss.xml')
  40.              ,(u'World'   , u'http://www.chinadaily.com.cn/rss/world_rss.xml'   )
  41.              ,(u'Sports'  , u'http://www.chinadaily.com.cn/rss/sports_rss.xml'  )
  42.              ,(u'Opinions', u'http://www.chinadaily.com.cn/rss/opinion_rss.xml' )
  43.             ]
  44.  
  45.     def preprocess_html(self, soup):
  46.         for item in soup.findAll(style=True):
  47.             del item['style']
  48.         return soup
  49.