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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010-2011, Darko Miletic <darko.miletic at gmail.com>'
  3. '''
  4. www.kommersant.ru
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class Kommersant_ru(BasicNewsRecipe):
  10.     title                 = 'Kommersant'
  11.     __author__            = 'Darko Miletic'
  12.     description           = 'News from Russia'
  13.     publisher             = 'Kommersant'
  14.     category              = 'news, politics, Russia'
  15.     oldest_article        = 5
  16.     max_articles_per_feed = 100
  17.     no_stylesheets        = True
  18.     use_embedded_content  = False
  19.     encoding              = 'cp1251'
  20.     language              = 'ru'
  21.     publication_type      = 'newspaper'
  22.     masthead_url          = 'http://www.kommersant.ru/CorpPics/logo_daily_1.gif'
  23.     extra_css             = """ 
  24.                               @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)}
  25.                               body{font-family: Tahoma, Arial, Helvetica, sans1, sans-serif}
  26.                               .title{font-size: x-large; font-weight: bold; margin-bottom: 1em}
  27.                               .subtitle{font-size: large; margin-bottom: 1em}
  28.                               .document_vvodka{font-weight: bold; margin-bottom: 1em}
  29.                             """
  30.  
  31.     conversion_options = {
  32.                           'comment'          : description
  33.                         , 'tags'             : category
  34.                         , 'publisher'        : publisher
  35.                         , 'language'         : language
  36.                         }
  37.  
  38.     keep_only_tags = [dict(attrs={'class':['document','document_vvodka','document_text','document_authors vblock']})]
  39.     remove_tags    = [dict(name=['iframe','object','link','img','base','meta'])]
  40.  
  41.     feeds       = [(u'Articles', u'http://feeds.kommersant.ru/RSS_Export/RU/daily.xml')]
  42.  
  43.     def print_version(self, url):        
  44.         return url.replace('/doc-rss/','/Doc/') + '/Print'
  45.