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

from calibre.web.feeds.news import BasicNewsRecipe


class GazetaUA(BasicNewsRecipe):
    title = 'Gazeta.ua'
    __author__ = 'bugmen00t'
    description = '\u0412\u0441\u0435\u0443\u043A\u0440\u0430\u0438\u043D\u0441\u043A\u0430\u044F \u043E\u043D-\u043B\u0430\u0439\u043D \u0433\u0430\u0437\u0435\u0442\u0430. \u041E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u043D\u044B\u0435 \u043D\u043E\u0432\u043E\u0441\u0442\u0438 \u0432 \u0423\u043A\u0440\u0430\u0438\u043D\u0435 \u0438 \u0432 \u043C\u0438\u0440\u0435: \u0441\u043E\u0431\u044B\u0442\u0438\u044F, \u043F\u043E\u043B\u0438\u0442\u0438\u043A\u0430, \u0441\u043F\u043E\u0440\u0442, \u043A\u0443\u043B\u044C\u0442\u0443\u0440\u0430.'  # noqa
    publisher = '\u0418\u0437\u0434\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0430\u044F \u0433\u0440\u0443\u043F\u043F\u0430 "\u041D\u043E\u0432\u0430 \u0456\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0456\u044F"'  # noqa
    category = 'newspaper'
    cover_url = u'https://static2.gazeta.ua/img2/cache/preview/1064/1064219_w_450.jpg'
    language = 'ru_UK'
    no_stylesheets = False
    remove_javascript = False
    auto_cleanup = False
    remove_empty_feeds = True
    oldest_article = 3
    max_articles_per_feed = 50

    remove_tags_before = dict(name='article')

    remove_tags_after = dict(name='section', attrs={'class': 'article-content clearfix'})

    remove_tags =   [
         dict(name='div', attrs={'class': 'mt5'}),
         dict(name='div', attrs={'class': 'interview-block'}),
         dict(name='p', attrs={'id': 'mce_0'}),
         dict(name='p', attrs={'id': 'mce_1'}),
         dict(name='p', attrs={'id': 'mce_2'}),
         dict(name='p', attrs={'id': 'mce_3'}),
         dict(name='p', attrs={'id': 'mce_4'}),
         dict(name='p', attrs={'id': 'mce_5'}),
         dict(name='p', attrs={'id': 'mce_6'}),
         dict(name='p', attrs={'id': 'mce_7'}),
         dict(name='p', attrs={'id': 'mce_8'}),
         dict(name='p', attrs={'id': 'mce_9'}),
         dict(name='p', attrs={'id': 'mce_10'}),
         dict(name='p', attrs={'id': 'mce_11'}),
         dict(name='p', attrs={'id': 'mce_12'}),
         dict(name='p', attrs={'id': 'mce_13'}),
         dict(name='p', attrs={'id': 'mce_14'}),
         dict(name='p', attrs={'id': 'mce_15'}),
         dict(name='p', attrs={'id': 'mce_16'}),
         dict(name='section', attrs={'class': 'w-marker-photo lg'})
        ]

    feeds = [
        ('Gazeta.ua', 'https://gazeta.ua/ru/rss')
        ]
