mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fixes #1795053 [News downloads no longer working](https://bugs.launchpad.net/calibre/+bug/1795053)
45 lines
1.2 KiB
Plaintext
45 lines
1.2 KiB
Plaintext
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 stuffconz(BasicNewsRecipe):
|
|
title = u'stuff.co.nz'
|
|
language = 'en_NZ'
|
|
__author__ = 'Krittika Goyal'
|
|
oldest_article = 1 # days
|
|
max_articles_per_feed = 25
|
|
|
|
keep_only_tags = [
|
|
classes('sics-component__headline sics-component__byline sics-component__story')
|
|
]
|
|
remove_tags = [
|
|
dict(name=['meta', 'link', 'style']),
|
|
classes('sics-component__sharebar'),
|
|
]
|
|
|
|
remove_stylesheets = True
|
|
feeds = [
|
|
('Dominion Post',
|
|
'http://www.stuff.co.nz/rss/dominion-post'),
|
|
('National',
|
|
'http://www.stuff.co.nz/rss/national'),
|
|
('World',
|
|
'http://www.stuff.co.nz/rss/world'),
|
|
('Business',
|
|
'http://www.stuff.co.nz/rss/business'),
|
|
('Technology',
|
|
'http://www.stuff.co.nz/rss/technology'),
|
|
('Sport',
|
|
'http://www.stuff.co.nz/rss/sport'),
|
|
('Entertainment',
|
|
'http://www.stuff.co.nz/rss/entertainment'),
|
|
('Life and Style',
|
|
'http://www.stuff.co.nz/rss/life-style'),
|
|
|
|
]
|