from calibre.web.feeds.news import BasicNewsRecipe try: from http.cookiejar import Cookie except ImportError: from cookielib import Cookie class BasicUserRecipe1333905513(BasicNewsRecipe): title = 'Trouw' __author__ = 'asalet_r' language = 'nl' description = '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 = [ ('Nederland', 'http://www.trouw.nl/nieuws/nederland/rss.xml'), ('Buitenland', 'http://www.trouw.nl/nieuws/buitenland/rss.xml'), ('Politiek', 'http://www.trouw.nl/nieuws/politiek/rss.xml'), ('Economie', 'http://www.trouw.nl/nieuws/economie/rss.xml'), ('Sport', 'http://www.trouw.nl/nieuws/sport/rss.xml'), ('Cultuur', 'http://www.trouw.nl/nieuws/cultuur/rss.xml'), ('Gezondheid', 'http://www.trouw.nl/nieuws/gezondheid/rss.xml'), ('Onderwijs', 'http://www.trouw.nl/nieuws/onderwijs/rss.xml'), ('Opinie', 'http://www.trouw.nl/opinie/rss.xml'), ('Groen', 'http://www.trouw.nl/groen/rss.xml'), ('Religie-Filosofie', 'http://www.trouw.nl/religie-filosofie/rss.xml'), ('Schrijf', 'http://www.trouw.nl/schrijf/rss.xml'), ('Moderne Manieren', 'http://www.trouw.nl/moderne-manieren/rss.xml'), ]