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

from calibre.web.feeds.news import BasicNewsRecipe


class Osvita(BasicNewsRecipe):
    title = '\u041e\u0441\u0432\u0456\u0442\u0430.ua'
    __author__ = 'bugmen00t'
    description = '\u0422\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u0441\u0443\u0440\u0441, \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0432 \u0423\u043a\u0440\u0430\u0438\u043d\u0435 \u0438 \u0437\u0430 \u0440\u0443\u0431\u0435\u0436\u043e\u043c.'  # noqa: E501
    publisher = '\u041e\u0441\u0432\u0456\u0442\u0430.ua'
    category = 'blog'
    cover_url = 'http://osvita.ua/doc/i/Contacts-logo.jpg'
    language = 'ru_UK'
    no_stylesheets = False
    remove_javascript = False
    auto_cleanup = False
    oldest_article = 7
    max_articles_per_feed = 30

    remove_tags_before = dict(name='div', attrs={'id': 'body'})

    remove_tags_after = dict(name='div', attrs={'id': 'body'})

    remove_tags = [
        # Unable to fetch images, removing them completely
        dict(name='img'),
        dict(name='p', attrs={'class': 'info'}),
    ]

    feeds = [('\u041d\u043e\u0432\u0438\u043d\u0438', 'https://ru.osvita.ua/rss/')]

    def print_version(self, url):
        return url + 'print'
