| 1 |
#!/usr/bin/env python |
| 2 |
# vim:fileencoding=utf-8 |
| 3 |
|
| 4 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 5 |
|
| 6 |
|
| 7 |
class UAFootball(BasicNewsRecipe): |
| 8 |
# Russian version |
| 9 |
# title = 'UA-\u0424\u0443\u0442\u0431\u043E\u043B' |
| 10 |
# language = 'ru_UK' |
| 11 |
# feeds = [ |
| 12 |
# ('\u041D\u043E\u0432\u043E\u0441\u0442\u0438 \u0444\u0443\u0442\u0431\u043E\u043B\u0430', 'https://www.ua-football.com/rss/all.xml') |
| 13 |
# ] |
| 14 |
|
| 15 |
# Ukrainian version |
| 16 |
title = 'UA-\u0424\u0443\u0442\u0431\u043e\u043b' |
| 17 |
description = ( |
| 18 |
'\u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0456 \u0442\u0435\u043c\u0438' |
| 19 |
' \u0444\u0443\u0442\u0431\u043e\u043b\u044c\u043d\u043e\u0433\u043e' |
| 20 |
' \u0436\u0438\u0442\u0442\u044f \u0423\u043a\u0440\u0430\u0457\u043d\u0438 \u0442\u0430' |
| 21 |
' \u0432\u0441\u044c\u043e\u0433\u043e \u0441\u0432\u0456\u0442\u0443.' |
| 22 |
) |
| 23 |
language = 'uk' |
| 24 |
feeds = [('\u041d\u043e\u0432\u0438\u043d\u0438', 'https://www.ua-football.com/ua/rss/all.xml')] |
| 25 |
|
| 26 |
__author__ = 'bugmen00t' |
| 27 |
publisher = '1766 TEAM EOOD' |
| 28 |
category = 'news' |
| 29 |
cover_url = 'https://yt3.googleusercontent.com/11FSvKeWcjFhzKrO7nXZdc-I__UeZ0mhZwbwyOHtnx_1-q6d0zQ2LbOt2duNCY06JVg2cGXS-g=s900-c-k-c0x00ffffff-no-rj' |
| 30 |
no_stylesheets = False |
| 31 |
remove_javascript = False |
| 32 |
auto_cleanup = False |
| 33 |
remove_empty_feeds = True |
| 34 |
oldest_article = 7 |
| 35 |
max_articles_per_feed = 200 |
| 36 |
|
| 37 |
remove_tags_before = dict(name='h1') |
| 38 |
|
| 39 |
remove_tags_after = dict(name='div', attrs={'class': 'show-post'}) |
| 40 |
|
| 41 |
remove_tags = [ |
| 42 |
dict(name='form'), |
| 43 |
dict(name='iframe'), |
| 44 |
dict(name='div', attrs={'class': 'language'}), |
| 45 |
dict(name='div', attrs={'class': 'article__read-also'}), |
| 46 |
dict(name='div', attrs={'class': 'card-player'}), |
| 47 |
dict(name='div', attrs={'class': 'show-post-socials'}), |
| 48 |
] |
| 49 |
|
| 50 |
# Replacing articles in Ukraininan for RU-feed |
| 51 |
# def print_version(self, url): |
| 52 |
# return url.replace('ua-football.com/ua/', 'ua-football.com/') |