home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_3854 < prev    next >
Encoding:
Text File  |  2010-05-10  |  1.9 KB  |  43 lines

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, 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             = ' @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} body{font-family: Arial, sans1, sans-serif} span#ctl00_ContentPlaceHolderStyle_LabelSubTitle{margin-bottom: 1em; display: block} .author{margin-bottom: 1em; display: block} .paragraph{margin-bottom: 1em; display: block} .vvodka{font-weight: bold; margin-bottom: 1em} '
  24.  
  25.     conversion_options = {
  26.                           'comment'          : description
  27.                         , 'tags'             : category
  28.                         , 'publisher'        : publisher
  29.                         , 'language'         : language
  30.                         }
  31.  
  32.     keep_only_tags = [
  33.                          dict(attrs={'id':'ctl00_ContentPlaceHolderStyle_PanelHeader'})
  34.                         ,dict(attrs={'class':['vvodka','paragraph','author']})
  35.                      ]
  36.     remove_tags        = [dict(name=['iframe','object','link','img','base'])]
  37.  
  38.     feeds       = [(u'Articles', u'http://feeds.kommersant.ru/RSS_Export/RU/daily.xml')]
  39.  
  40.     def print_version(self, url):
  41.         return url.replace('doc-rss.aspx','doc.aspx') + '&print=true'
  42.  
  43.