__license__ = 'GPL v3' __copyright__ = '2010-2011, Darko Miletic ' ''' www.kommersant.ru ''' from calibre.web.feeds.news import BasicNewsRecipe class Kommersant_ru(BasicNewsRecipe): title = 'Kommersant' __author__ = 'Darko Miletic' description = 'News from Russia' publisher = 'Kommersant' category = 'news, politics, Russia' oldest_article = 5 max_articles_per_feed = 100 no_stylesheets = True use_embedded_content = False encoding = 'cp1251' language = 'ru' publication_type = 'newspaper' masthead_url = 'http://www.kommersant.ru/CorpPics/logo_daily_1.gif' extra_css = """ @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} body{font-family: Tahoma, Arial, Helvetica, sans1, sans-serif} .title{font-size: x-large; font-weight: bold; margin-bottom: 1em} .subtitle{font-size: large; margin-bottom: 1em} .document_vvodka{font-weight: bold; margin-bottom: 1em} """ conversion_options = { 'comment' : description , 'tags' : category , 'publisher' : publisher , 'language' : language } keep_only_tags = [dict(attrs={'class':['document','document_vvodka','document_text','document_authors vblock']})] remove_tags = [dict(name=['iframe','object','link','img','base','meta'])] feeds = [(u'Articles', u'http://feeds.kommersant.ru/RSS_Export/RU/daily.xml')] def print_version(self, url): return url.replace('/doc-rss/','/Doc/') + '/Print'