mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
52 lines
2.0 KiB
Plaintext
52 lines
2.0 KiB
Plaintext
from calibre.web.feeds.news import BasicNewsRecipe
|
|
try:
|
|
from http.cookiejar import Cookie
|
|
except ImportError:
|
|
from cookielib import Cookie
|
|
|
|
|
|
class BasicUserRecipe1333905513(BasicNewsRecipe):
|
|
title = u'Trouw'
|
|
__author__ = 'asalet_r'
|
|
language = 'nl'
|
|
description = u'Trouw de Verdieping'
|
|
oldest_article = 1
|
|
max_articles_per_feed = 25
|
|
no_stylesheets = True
|
|
|
|
def get_browser(self):
|
|
br = BasicNewsRecipe.get_browser(self)
|
|
# Add a cookie indicating we have accepted the cookie
|
|
# policy
|
|
ck = Cookie(
|
|
version=0, name='nl_cookiewall_version', value='1', port=None,
|
|
port_specified=False, domain='.trouw.nl',
|
|
domain_specified=False, domain_initial_dot=True, path='/',
|
|
path_specified=False, secure=False, expires=None, discard=False,
|
|
comment=None, comment_url=None, rest={'HttpOnly': None}, rfc2109=False)
|
|
br.cookiejar.set_cookie(ck)
|
|
return br
|
|
|
|
keep_only_tags = [
|
|
dict(id=['articleDetailTitle', 'art_box2']),
|
|
]
|
|
remove_tags = [
|
|
dict(attrs={'class': 'twitter-tweet'}),
|
|
]
|
|
|
|
feeds = [
|
|
(u'Nederland', u'http://www.trouw.nl/nieuws/nederland/rss.xml'),
|
|
(u'Buitenland', u'http://www.trouw.nl/nieuws/buitenland/rss.xml'),
|
|
(u'Politiek', u'http://www.trouw.nl/nieuws/politiek/rss.xml'),
|
|
(u'Economie', u'http://www.trouw.nl/nieuws/economie/rss.xml'),
|
|
(u'Sport', u'http://www.trouw.nl/nieuws/sport/rss.xml'),
|
|
(u'Cultuur', u'http://www.trouw.nl/nieuws/cultuur/rss.xml'),
|
|
(u'Gezondheid', u'http://www.trouw.nl/nieuws/gezondheid/rss.xml'),
|
|
(u'Onderwijs', u'http://www.trouw.nl/nieuws/onderwijs/rss.xml'),
|
|
(u'Opinie', u'http://www.trouw.nl/opinie/rss.xml'),
|
|
(u'Groen', u'http://www.trouw.nl/groen/rss.xml'),
|
|
(u'Religie-Filosofie', u'http://www.trouw.nl/religie-filosofie/rss.xml'),
|
|
(u'Schrijf', u'http://www.trouw.nl/schrijf/rss.xml'),
|
|
(u'Moderne Manieren', u'http://www.trouw.nl/moderne-manieren/rss.xml')
|
|
]
|