#!/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
    publisher = '\u041E\u0441\u0432\u0456\u0442\u0430.ua'
    category = 'blog'
    cover_url = u'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'
