| 1 |
#!/usr/bin/env python |
| 2 |
# vim:fileencoding=utf-8 |
| 3 |
from __future__ import absolute_import, division, print_function, unicode_literals |
| 4 |
|
| 5 |
__license__ = 'GPL v3' |
| 6 |
__copyright__ = '2009, Gerhard Aigner <gerhard.aigner at gmail.com>' |
| 7 |
|
| 8 |
''' http://www.diepresse.at - Austrian Newspaper ''' |
| 9 |
|
| 10 |
import re |
| 11 |
|
| 12 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 13 |
|
| 14 |
|
| 15 |
class DiePresseRecipe(BasicNewsRecipe): |
| 16 |
title = 'Die Presse' |
| 17 |
__author__ = 'Gerhard Aigner' |
| 18 |
description = 'DiePresse.com - Die Online-Ausgabe der Österreichischen Tageszeitung Die Presse.' |
| 19 |
publisher = 'Die Presse Verlags-Gesellschaft m.b.H. Co KG' |
| 20 |
language = 'de_AT' |
| 21 |
category = 'news, politics, nachrichten, Austria' |
| 22 |
use_embedded_content = False |
| 23 |
remove_empty_feeds = True |
| 24 |
no_stylesheets = True |
| 25 |
|
| 26 |
recursions = 0 |
| 27 |
oldest_article = 1 |
| 28 |
max_articles_per_feed = 100 |
| 29 |
|
| 30 |
preprocess_regexps = [ |
| 31 |
(re.compile(r'Textversion', re.DOTALL), lambda match: ''), |
| 32 |
] |
| 33 |
|
| 34 |
remove_tags = [ |
| 35 |
dict(name='hr'), |
| 36 |
dict(name='br'), |
| 37 |
dict(name='small'), |
| 38 |
dict(name='img'), |
| 39 |
dict(name='div', attrs={'class': 'textnavi'}), |
| 40 |
dict(name='h1', attrs={'class': 'titel'}), |
| 41 |
dict(name='a', attrs={'class': 'print'}), |
| 42 |
dict(name='div', attrs={'class': 'hline'}), |
| 43 |
] |
| 44 |
|
| 45 |
remove_tags_after = [dict(name='div', attrs={'class': 'articletext'})] |
| 46 |
|
| 47 |
feeds = [ |
| 48 |
('Politik', 'http://diepresse.com/rss/Politik'), |
| 49 |
('Wirtschaft', 'http://diepresse.com/rss/Wirtschaft'), |
| 50 |
('Europa', 'http://diepresse.com/rss/EU'), |
| 51 |
('Panorama', 'http://diepresse.com/rss/Panorama'), |
| 52 |
('Sport', 'http://diepresse.com/rss/Sport'), |
| 53 |
('Kultur', 'http://diepresse.com/rss/Kultur'), |
| 54 |
('Leben', 'http://diepresse.com/rss/Leben'), |
| 55 |
('Tech', 'http://diepresse.com/rss/Tech'), |
| 56 |
('Wissenschaft', 'http://diepresse.com/rss/Science'), |
| 57 |
('Bildung', 'http://diepresse.com/rss/Bildung'), |
| 58 |
('Gesundheit', 'http://diepresse.com/rss/Gesundheit'), |
| 59 |
('Recht', 'http://diepresse.com/rss/Recht'), |
| 60 |
('Spectrum', 'http://diepresse.com/rss/Spectrum'), |
| 61 |
('Meinung', 'http://diepresse.com/rss/Meinung'), |
| 62 |
] |
| 63 |
|
| 64 |
def print_version(self, url): |
| 65 |
return url.replace('home', 'text/home') |