Debian Codegraph @

recipes/trv.recipe

raw
1 #!/usr/bin/env python
2 # vim:fileencoding=utf-8
3
4 from __future__ import absolute_import, division, print_function, unicode_literals
5
6 from calibre.web.feeds.news import BasicNewsRecipe
7
8
9 class TrvScience(BasicNewsRecipe):
10 title = '\u0422\u0440\u043e\u0438\u0446\u043a\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442'
11 language = 'ru'
12 __author__ = 'Vadim Dyadkin (with fixes by bugmen00t)'
13 oldest_article = 30
14 max_articles_per_feed = 100
15 recursion = 4
16 no_stylesheets = True
17 simultaneous_downloads = 1
18 # cover_url = 'https://i0.wp.com/trv-science.ru/uploads/logo_trv2-e1573805568596-1.png'
19 cover_url = 'https://i0.wp.com/trv-science.ru/uploads/cropped-trv_neur-1024.png'
20
21 remove_tags_before = dict(name='main', attrs={'id': 'main'})
22
23 remove_tags_after = dict(name='div', attrs={'class': 'wpdiscuz-comment-pagination'})
24
25 remove_tags = [
26 dict(name='span', attrs={'class': 'fa fa-user'}),
27 dict(name='h4'),
28 dict(name='svg'),
29 dict(name='ul', attrs={'class': 'st-related-posts'}),
30 dict(name='footer', attrs={'class': 'entry-meta'}),
31 # dict(name='div', attrs={'id': 'comments'}),
32 dict(name='div', attrs={'class': 'wpd-vote'}),
33 dict(name='div', attrs={'class': 'mistape_caption'}),
34 dict(name='div', attrs={'class': 'wpd-comment-share wpd-hidden wpd-tooltip wpd-top'}),
35 dict(name='div', attrs={'class': 'wpd-comment-left '}),
36 dict(name='div', attrs={'class': 'wpd-space'}),
37 dict(name='div', attrs={'class': 'wpd-reply-button'}),
38 dict(name='div', attrs={'class': 'wpd-comment-link wpd-hidden'}),
39 dict(name='div', attrs={'class': 'wpd-comment-last-edited'}),
40 dict(name='div', attrs={'class': 'wpd-comment-date'}),
41 dict(name='div', attrs={'class': 'wpd-comment-info-bar'}),
42 dict(name='div', attrs={'class': 'wpd-form-wrap'}),
43 ]
44
45 feeds = [('\u0422\u0440\u043e\u0438\u0446\u043a\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442', 'https://trv-science.ru/feed/')]