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

from calibre.web.feeds.news import BasicNewsRecipe


class TheBell(BasicNewsRecipe):
    title = 'The Bell'
    __author__ = 'bugmen00t'
    description = '\u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0438\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0431\u044e\u043b\u043b\u0435\u0442\u0435\u043d\u044c, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0449\u0435\u0435\u0441\u044f \u043d\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u043d\u043e\u0432\u043e\u0441\u0442\u044f\u0445.'  # noqa: E501
    publisher = '\u0415\u043b\u0438\u0437\u0430\u0432\u0435\u0442\u0430 \u041e\u0441\u0435\u0442\u0438\u043d\u0441\u043a\u0430\u044f, \u0418\u0440\u0438\u043d\u0430 \u041c\u0430\u043b\u043a\u043e\u0432\u0430'  # noqa: E501
    category = 'newspaper'
    cover_url = 'https://thebell.io/wp-content/uploads/2018/03/thebell-cover.png'
    language = 'ru'
    no_stylesheets = True
    remove_javascript = False
    auto_cleanup = False
    oldest_article = 7
    max_articles_per_feed = 20

    remove_tags_before = dict(name='h1')

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

    remove_tags = [
        dict(name='div', attrs={'class': 'post_bottom ng-tns-c84-1 ng-star-inserted'}),
        dict(name='div', attrs={'class': 'post_tags ng-tns-c84-1 ng-star-inserted'}),
        dict(name='div', attrs={'class': 'post_subscribe ng-tns-c84-1 ng-star-inserted'}),
        dict(name='div', attrs={'class': 'author__content_image author__content_image_small ng-star-inserted'}),
        dict(name='div', attrs={'class': 'email email_small ng-star-inserted'}),
        dict(name='div', attrs={'class': 'post_share ng-tns-c84-1'}),
        dict(name='div', attrs={'class': 'social_media'}),
    ]

    feeds = [('The Bell', 'https://thebell.io/feed')]
