Debian Codegraph @

recipes/newslaundry.recipe

raw
1 from calibre.web.feeds.news import BasicNewsRecipe
2
3
4 class newslaundry(BasicNewsRecipe):
5 title = 'Newslaundry'
6 __author__ = 'unkn0wn'
7 description = (
8 'Newslaundry is a reader-supported, independent news media company. In an industry driven by corporate'
9 ' and government interests, we strongly believe in the need for an independent news model, and a free'
10 ' and accountable press.'
11 )
12 language = 'en_IN'
13 masthead_url = 'https://images.assettype.com/newslaundry/2020-01/d91cad07-9650-47e9-8bdc-9a6247354d95/Header_logo_NL__2_New.png'
14 encoding = 'utf-8'
15 no_stylesheets = True
16 remove_javascript = True
17 oldest_article = 7 # days
18 resolve_internal_links = True
19
20 ignore_duplicate_articles = {'url'}
21
22 # keep_only_tags = [classes('headline subheadline authorWithTimeStamp story-card')]
23
24 feeds = [('Articles', 'https://www.newslaundry.com/stories.rss?time-period=last-7-days')]
25
26 # def preprocess_html(self, soup):
27 # if h1 := soup.find(**classes('headline')):
28 # h1.name = 'h1'
29 # if h3 := soup.find(**classes('subheadline')):
30 # h3.name = 'h3'
31 # return soup
32
33 def print_version(self, url):
34 if 'hindi.newslaundry' in url:
35 self.abort_article('Skipping hindi article') # remove this line if you want hindi articles.
36 return url