Debian Codegraph @

recipes/novaya_gazeta_europe_en.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 NovayaGazetaEurope(BasicNewsRecipe):
8 title = 'Novaya Gazeta Europe'
9 __author__ = 'bugmen00t'
10 description = 'English edition of Novaya Gazeta Europe: news, analytics, expert opinions, special reports and investigative journalism.'
11 publisher = 'Kirill Martynov'
12 category = 'news'
13 language = 'en_RU'
14 cover_url = 'https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/5dc71e2d-9763-4f05-8f4e-92049fa32af7_513x513.png'
15 oldest_article = 15
16 max_articles_per_feed = 50
17 auto_cleanup = False
18
19 remove_tags_before = dict(name='h1')
20
21 remove_tags_after = dict(name='div', attrs={'class': 'ArticleBlocks_wrapperNoAside__11_bu'})
22
23 remove_tags = [dict(name='div', attrs={'class': 'EmbedNative_root__2lgsH'})]
24
25 feeds = [('News', 'https://novayagazeta.eu/feed/rss/en')]
26
27 def preprocess_html(self, soup):
28 for alink in soup.findAll('a'):
29 if alink.string is not None:
30 tstr = alink.string
31 alink.replaceWith(tstr)
32 return soup