mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
India speaks reddit feed
Also some more changes to NYPost
This commit is contained in:
parent
d1bd7b73eb
commit
d9c1cb9501
@ -18,5 +18,5 @@ class HinduHumanRights(BasicNewsRecipe):
|
||||
auto_cleanup = True
|
||||
|
||||
feeds = [
|
||||
('HHR main', 'https://www.hindusforhumanrights.org/en/home-6?format=rss'),
|
||||
('HHR main', 'https://www.hindusforhumanrights.org/en/home?format=rss'),
|
||||
]
|
||||
|
23
recipes/india_speaks_reddit.recipe
Normal file
23
recipes/india_speaks_reddit.recipe
Normal file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python
|
||||
# vim:fileencoding=utf-8
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
def classes(classes):
|
||||
q = frozenset(classes.split(' '))
|
||||
return dict(
|
||||
attrs={'class': lambda x: x and frozenset(x.split()).intersection(q)})
|
||||
|
||||
|
||||
class IndiaSpeaksReddit(BasicNewsRecipe):
|
||||
title = 'IndiaSpeaksReddit'
|
||||
__author__ = 'Vishvas Vasuki'
|
||||
language = 'en_IN'
|
||||
oldest_article = 1
|
||||
max_articles_per_feed = 100
|
||||
auto_cleanup = True
|
||||
|
||||
feeds = [
|
||||
('India Speaks Reddit main feed', 'https://www.reddit.com/r/IndiaSpeaks.rss'),
|
||||
]
|
||||
|
@ -32,7 +32,10 @@ class NewYorkPost(BasicNewsRecipe):
|
||||
keep_only_tags = [
|
||||
dict(itemprop=['headline', 'articleBody']),
|
||||
dict(name='h1'),
|
||||
classes('byline byline-date source article-info entry-content entry-content-read-more featured-image'),
|
||||
classes(
|
||||
'byline byline-date source article-info entry-content entry-content-read-more featured-image'
|
||||
' headline--single date meta meta--byline Date published'
|
||||
),
|
||||
]
|
||||
|
||||
remove_tags = [
|
||||
@ -40,7 +43,7 @@ class NewYorkPost(BasicNewsRecipe):
|
||||
classes(
|
||||
'floating-share floating-share-wrap sharedaddy sd-sharing-enabled tag-list module-wrapper'
|
||||
' inline-module--author inline-module--columnist inline-module--primary-tag'
|
||||
' author-flyout modal__email-author button gowatchit-inline'
|
||||
' author-flyout modal__email-author button gowatchit-inline updated select-share__title'
|
||||
),
|
||||
dict(name=['link', 'meta']),
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user