| 1 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 2 |
|
| 3 |
try: |
| 4 |
from http.cookiejar import Cookie |
| 5 |
except ImportError: |
| 6 |
from cookielib import Cookie |
| 7 |
|
| 8 |
|
| 9 |
class BasicUserRecipe1333905513(BasicNewsRecipe): |
| 10 |
title = 'Trouw' |
| 11 |
__author__ = 'asalet_r' |
| 12 |
language = 'nl' |
| 13 |
description = 'Trouw de Verdieping' |
| 14 |
oldest_article = 1 |
| 15 |
max_articles_per_feed = 25 |
| 16 |
no_stylesheets = True |
| 17 |
|
| 18 |
def get_browser(self): |
| 19 |
br = BasicNewsRecipe.get_browser(self) |
| 20 |
# Add a cookie indicating we have accepted the cookie |
| 21 |
# policy |
| 22 |
ck = Cookie( |
| 23 |
version=0, |
| 24 |
name='nl_cookiewall_version', |
| 25 |
value='1', |
| 26 |
port=None, |
| 27 |
port_specified=False, |
| 28 |
domain='.trouw.nl', |
| 29 |
domain_specified=False, |
| 30 |
domain_initial_dot=True, |
| 31 |
path='/', |
| 32 |
path_specified=False, |
| 33 |
secure=False, |
| 34 |
expires=None, |
| 35 |
discard=False, |
| 36 |
comment=None, |
| 37 |
comment_url=None, |
| 38 |
rest={'HttpOnly': None}, |
| 39 |
rfc2109=False, |
| 40 |
) |
| 41 |
br.cookiejar.set_cookie(ck) |
| 42 |
return br |
| 43 |
|
| 44 |
keep_only_tags = [ |
| 45 |
dict(id=['articleDetailTitle', 'art_box2']), |
| 46 |
] |
| 47 |
remove_tags = [ |
| 48 |
dict(attrs={'class': 'twitter-tweet'}), |
| 49 |
] |
| 50 |
|
| 51 |
feeds = [ |
| 52 |
('Nederland', 'http://www.trouw.nl/nieuws/nederland/rss.xml'), |
| 53 |
('Buitenland', 'http://www.trouw.nl/nieuws/buitenland/rss.xml'), |
| 54 |
('Politiek', 'http://www.trouw.nl/nieuws/politiek/rss.xml'), |
| 55 |
('Economie', 'http://www.trouw.nl/nieuws/economie/rss.xml'), |
| 56 |
('Sport', 'http://www.trouw.nl/nieuws/sport/rss.xml'), |
| 57 |
('Cultuur', 'http://www.trouw.nl/nieuws/cultuur/rss.xml'), |
| 58 |
('Gezondheid', 'http://www.trouw.nl/nieuws/gezondheid/rss.xml'), |
| 59 |
('Onderwijs', 'http://www.trouw.nl/nieuws/onderwijs/rss.xml'), |
| 60 |
('Opinie', 'http://www.trouw.nl/opinie/rss.xml'), |
| 61 |
('Groen', 'http://www.trouw.nl/groen/rss.xml'), |
| 62 |
('Religie-Filosofie', 'http://www.trouw.nl/religie-filosofie/rss.xml'), |
| 63 |
('Schrijf', 'http://www.trouw.nl/schrijf/rss.xml'), |
| 64 |
('Moderne Manieren', 'http://www.trouw.nl/moderne-manieren/rss.xml'), |
| 65 |
] |