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

from calibre.web.feeds.news import BasicNewsRecipe


class LigaNet(BasicNewsRecipe):
    title = '\u041b\u0406\u0413\u0410.net (UA)'
    __author__ = 'bugmen00t'
    description = '\u0414\u0456\u043b\u043e\u0432\u0438\u0439 \u043d\u043e\u0432\u0438\u043d\u043d\u0438\u0439 \u043f\u043e\u0440\u0442\u0430\u043b'
    publisher = 'Ligamedia'
    category = 'blog'
    cover_url = 'https://www.liga.net/design/images/logo_liga.png'
    language = 'uk'
    no_stylesheets = False
    remove_javascript = False
    auto_cleanup = False
    oldest_article = 7
    max_articles_per_feed = 30

    remove_tags_before = dict(name='h1')

    remove_tags_after = dict(name='div', attrs={'id': 'news-text'})

    remove_tags = [
        dict(name='footer'),
        dict(name='div', attrs={'class': 'more-link red'}),
        dict(name='div', attrs={'class': 'read-too'}),
        dict(name='div', attrs={'class': 'to-send-row'}),
        dict(name='div', attrs={'class': 'hint-row'}),
        dict(name='div', attrs={'class': 'chronicle-top-eye'}),
        dict(name='div', attrs={'class': 'chronicle-top-comm comm-btns'}),
        dict(name='div', attrs={'class': 'chronicle-news m-t-30'}),
        dict(name='div', attrs={'class': 'right-inner-content'}),
        dict(name='div', attrs={'class': 'right-part'}),
        dict(name='div', attrs={'class': 'article-footer article-content__footer'}),
        dict(name='div', attrs={'class': 'tags article__tags'}),
        dict(name='div', attrs={'class': 'article-sidebar article-grid__sidebar'}),
        dict(name='div', attrs={'class': 'hreflang-link'}),
        dict(name='div', attrs={'class': 'vakansii-block-article'}),
        dict(name='div', attrs={'class': 'col-12 col-md p-side-10 sp-card-paddings'}),
        dict(name='div', attrs={'class': 'social-shares d-flex justify-content-center'}),
        dict(name='div', attrs={'class': 'social-shares d-block'}),
        dict(name='div', attrs={'class': 'social-likes clearfix hidden-1280 '}),
        dict(name='div', attrs={'class': 'soc-item comm-btns'}),
        dict(name='div', attrs={'class': 'soc-buttons'}),
        dict(name='div', attrs={'class': 'warning m-t-20 d-none d-md-none d-lg-block'}),
        dict(name='div', attrs={'id': 'news-list-right'}),
        dict(name='div', attrs={'id': 'premium_mobile'}),
        dict(name='div', attrs={'id': 'premium2_mobile'}),
        dict(name='div', attrs={'class': 'marketing-block'}),
        dict(name='span', attrs={'class': 'social-likes__button'}),
        dict(name='div', attrs={'class': 'marketing-block'}),
    ]

    feeds = [
        (
            '\u041d\u043e\u0432\u0438\u043d\u0438: \u0433\u043e\u043b\u043e\u0432\u043d\u0456 \u043c\u0430\u0442\u0435\u0440\u0456\u0430\u043b\u0438',
            'https://www.liga.net/newsua/top/rss.xml',
        ),
        (
            '\u041d\u043e\u0432\u0438\u043d\u0438: \u0432\u0441\u0456 \u043c\u0430\u0442\u0435\u0440\u0456\u0430\u043b\u0438',
            'https://www.liga.net/newsua/all/rss.xml',
        ),
    ]
