__license__ = 'GPL v3'
__copyright__ = '2012, Darko Miletic <darko.miletic at gmail.com>'
'''
english.pravda.ru
'''

from calibre.web.feeds.news import BasicNewsRecipe


class Pravda_eng(BasicNewsRecipe):
    title = 'Pravda in English'
    __author__ = 'Darko Miletic'
    description = 'News from Russia and rest of the world'
    publisher = 'PRAVDA.Ru'
    category = 'news, politics, Russia'
    oldest_article = 2
    max_articles_per_feed = 200
    no_stylesheets = True
    encoding = 'utf8'
    use_embedded_content = False
    language = 'en_RU'
    remove_empty_feeds = True
    publication_type = 'newspaper'
    masthead_url = 'http://english.pravda.ru/pix/logo.gif'
    extra_css             = """
                               body{font-family: Arial,sans-serif }
                               img{margin-bottom: 0.4em; display:block}
                            """

    conversion_options = {
        'comment': description, 'tags': category, 'publisher': publisher, 'language': language
    }

    remove_attributes = ['lang', 'style']
    keep_only_tags = [dict(name='div', attrs={'id': 'article'})]

    feeds = [

    (u'World', u'http://english.pravda.ru/world/export-articles.xml'),
    (u'Russia', u'http://english.pravda.ru/russia/export-articles.xml'),
    (u'Society', u'http://english.pravda.ru/society/export-articles.xml'),
    (u'Incidents', u'http://english.pravda.ru/hotspots/export-articles.xml'),
    (u'Opinion', u'http://english.pravda.ru/opinion/export-articles.xml'),
    (u'Science', u'http://english.pravda.ru/science/export-articles.xml'),
    (u'Business', u'http://english.pravda.ru/business/export-articles.xml'),
    (u'Economics', u'http://english.pravda.ru/russia/economics/export-articles.xml'),
    (u'Politics', u'http://english.pravda.ru/russia/politics/export-articles.xml')
    ]

    def print_version(self, url):
        return url + '?mode=print'
