Debian Codegraph @

recipes/grani.recipe

raw
1 #!/usr/bin/env python
2 # vim:fileencoding=utf-8
3
4 from calibre.web.feeds.news import BasicNewsRecipe
5
6
7 class Grani(BasicNewsRecipe):
8 title = '\u0413\u0440\u0430\u043d\u0438.\u0420\u0443'
9 __author__ = 'bugmen00t'
10 description = '\u0415\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0433\u0430\u0437\u0435\u0442\u0430. \u041e\u0431\u0437\u043e\u0440\u044b \u0438 \u0430\u043d\u0430\u043b\u0438\u0437 \u0440\u043e\u0441\u0441\u0438\u0439\u0441\u043a\u0438\u0445 \u0438 \u043c\u0438\u0440\u043e\u0432\u044b\u0445 \u043f\u043e\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u0432\u0438\u0434\u0435\u043e \u043e \u043f\u043e\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u043a\u043b\u044e\u0447\u0451\u043d\u043d\u044b\u0445.' # noqa: E501
11 publisher = '\u041e\u041e\u041e "\u0424\u043b\u0430\u0432\u0443\u0441"'
12 category = 'newspaper'
13 cover_url = 'https://graniru.org/files/96172.png'
14 language = 'ru'
15 no_stylesheets = False
16 remove_javascript = False
17 auto_cleanup = False
18 remove_empty_feeds = True
19 oldest_article = 30
20 max_articles_per_feed = 50
21
22 remove_tags_before = dict(name='h3')
23
24 remove_tags_after = dict(name='div', attrs={'class': 'main-text clearfix'})
25
26 # Original feeds
27 # feeds = [
28 # ('\u0412\u0441\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u044B', 'https://graniru.org/export/all-atom.xml'),
29 # ('\u0421\u0442\u0430\u0442\u044C\u0438', 'https://graniru.org/export/articles-atom.xml')
30 # ]
31
32 # Feeds from mirror site
33 feeds = [
34 ('\u0412\u0441\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b', 'https://grani2.appspot.com/export/all-atom.xml'),
35 ('\u0421\u0442\u0430\u0442\u044c\u0438', 'https://grani2.appspot.com/export/articles-atom.xml'),
36 ]
37
38 # Mirror site feeds transformation
39 def print_version(self, url):
40 return url.replace('https://graniru.org/', 'https://grani2.appspot.com/')