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

from calibre.web.feeds.news import BasicNewsRecipe


class KnifeMedia(BasicNewsRecipe):
    title = '\u041D\u043E\u0436'
    __author__ = 'bugmen00t'
    description = '\u0418\u043D\u0442\u0435\u043B\u043B\u0435\u043A\u0442\u0443\u0430\u043B\u044C\u043D\u044B\u0439 \u0436\u0443\u0440\u043D\u0430\u043B \u043E \u043A\u0443\u043B\u044C\u0442\u0443\u0440\u0435 \u0438 \u043E\u0431\u0449\u0435\u0441\u0442\u0432\u0435'  # noqa
    publisher = '\u041C\u0438\u0445\u0430\u0438\u043B \u0426\u044B\u0433\u0430\u043D, \u0422\u0430\u0442\u044C\u044F\u043D\u0430 \u041A\u043E\u044D\u043D'
    category = 'blog'
    cover_url = u'https://knife.media/feature/pdd/img/knife_logo.33a98aee.svg'
    language = 'ru'
    no_stylesheets = False
    remove_javascript = False
    auto_cleanup = False
    oldest_article = 14
    max_articles_per_feed = 30

    remove_tags_before = dict(name='div', attrs={'class': 'entry-header'})

    remove_tags_after = dict(name='div', attrs={'class': 'entry-content'})

    remove_tags = [
        dict(name='aside'),
        dict(name='div', attrs={'class': 'entry-header__share share'}),
        dict(name='div', attrs={'class': 'entry-comments'}),
        dict(name='div', attrs={'class': 'entry-footer'}),
        dict(name='div', attrs={'class': 'entry-bottom'}),
        dict(name='figure', attrs={'class': 'figure figure--similar'})
    ]

    feeds = [(
        '\u041B\u043E\u043D\u0433\u0440\u0438\u0434\u044B',
        'https://knife.media/category/longreads/feed/'
    ),
             (
                 '\u041D\u043E\u0432\u043E\u0441\u0442\u0438',
                 'https://knife.media/category/news/feed/'
             )]
