#!/usr/bin/env python
# vim:fileencoding=utf-8

from calibre.web.feeds.news import BasicNewsRecipe


class PravdaUAEN(BasicNewsRecipe):
    title = 'Ukrainska Pravda'
    __author__ = 'bugmen00t'
    description = ' Ukrainian online newspaper founded by Georgiy Gongadze with an emphasis on the politics of Ukraine. '
    publisher = 'pravda.com.ua'
    category = 'newspaper'
    cover_url = 'https://img.pravda.com/images/up_for_fb.gif'
    language = 'en_UK'
    no_stylesheets = False
    remove_javascript = False
    auto_cleanup = False
    oldest_article = 30
    max_articles_per_feed = 30

    remove_tags_before = dict(name='h1')

    remove_tags_after = dict(name='article', attrs={'class': 'post'})

    remove_tags = [
        dict(name='footer'),
        dict(name='div', attrs={'class': 'nts-video-wrapper'}),
        dict(name='div', attrs={'class': 'post-report'}),
        dict(name='div', attrs={'class': 'post__report'}),
        dict(name='div', attrs={'class': 'social_item'}),
        dict(name='div', attrs={'class': 'sidebar'}),
        dict(name='div', attrs={'class': 'article-announcement-photo article-announcement-photo-block-1'}),
        dict(name='div', attrs={'class': 'statistic-bottom-block statistic-top-block'}),
        dict(name='div', attrs={'class': 'modal modal_search modal_white'}),
        dict(name='div', attrs={'class': 'modal_auth modal_white'}),
        dict(name='div', attrs={'class': 'main_logo'}),
        dict(name='div', attrs={'class': 'footer_banner'}),
        dict(name='nav', attrs={'class': 'block block_menu'}),
        dict(name='div', attrs={'class': 'pagewrap page-point'}),
        dict(name='div', attrs={'class': 'modal fade search-popup'}),
        dict(name='div', attrs={'data-vr-zone': 'Mobile main menu'}),
        dict(name='aside'),
        dict(name='div', attrs={'class': 'block_related'}),
        dict(name='div', attrs={'class': 'block_comments'}),
        dict(name='div', attrs={'class': 'post_tags'}),
        dict(name='div', attrs={'class': 'post__tags'}),
    ]

    feeds = [
        ('All materials', 'https://www.pravda.com.ua/eng/rss/'),
        ('Top news', 'https://www.pravda.com.ua/eng/rss/view_mainnews/'),
        ('News', 'https://www.pravda.com.ua/eng/rss/view_news/'),
        ('Articles', 'https://www.pravda.com.ua/eng/rss/view_pubs/'),
    ]
