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

from calibre.web.feeds.news import BasicNewsRecipe


class UkrInform(BasicNewsRecipe):
    title = '\u30a6\u30af\u30eb\u30a4\u30f3\u30d5\u30a9\u30eb\u30e0\uff08UkrInform\uff09'
    __author__ = 'bugmen00t'
    description = '\u30a6\u30af\u30e9\u30a4\u30ca\u3067\u552f\u4e00\u306e\u56fd\u55b6\u901a\u4fe1\u793e\u3067\u3059\u3001\u56fd\u5185\u6700\u5927\u306e\u5730\u65b9\u652f\u90e8\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3068\u8907\u6570\u306e\u5916\u56fd\u652f\u5c40\u3092\u6709\u3057\u3066\u3044\u307e\u3059\u3002'  # noqa: E501
    publisher = '\u30a6\u30af\u30e9\u30a4\u30ca\u6587\u5316\u30fb\u60c5\u5831\u653f\u7b56\u7701'
    category = 'newspaper'
    cover_url = 'https://static.ukrinform.com/photos/2022_05/thumb_files/630_360_1651819943-560.jpg'
    language = 'ja'
    no_stylesheets = True
    remove_javascript = False
    auto_cleanup = False
    oldest_article = 7
    max_articles_per_feed = 30

    remove_tags_before = dict(name='article')

    remove_tags_after = dict(name='article')

    remove_tags = [
        dict(name='aside'),
        dict(name='img', attrs={'class': 'pixel'}),
        dict(name='section', attrs={'class': 'read'}),
        dict(name='div', attrs={'data-name': 'int_hidden'}),
    ]

    feeds = [
        ('\u65b0\u7740\u30cb\u30e5\u30fc\u30b9', 'https://www.ukrinform.jp/rss/block-lastnews'),
        ('\u6226\u4e89', 'https://www.ukrinform.jp/rss/rubric-ato'),
        ('\u653f\u6cbb', 'https://www.ukrinform.jp/rss/rubric-polytics'),
        ('\u7d4c\u6e08', 'https://www.ukrinform.jp/rss/rubric-economy'),
        ('\u9632\u885b', 'https://www.ukrinform.jp/rss/rubric-defense'),
        ('\u793e\u4f1a\u30fb\u6587\u5316', 'https://www.ukrinform.jp/rss/rubric-society'),
        ('\u30b9\u30dd\u30fc\u30c4', 'https://www.ukrinform.jp/rss/rubric-sports'),
        ('\u72af\u7f6a', 'https://www.ukrinform.jp/rss/rubric-crime'),
        ('\u4e8b\u6545\u30fb\u7dca\u6025\u4e8b\u614b', 'https://www.ukrinform.jp/rss/rubric-emergencies'),
    ]
