Update Die Presse

This commit is contained in:
Kovid Goyal 2016-05-15 07:58:38 +05:30
parent 905740d818
commit 81182e7ae8

View File

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*- #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
__license__ = 'GPL v3' __license__ = 'GPL v3'
__copyright__ = '2009, Gerhard Aigner <gerhard.aigner at gmail.com>' __copyright__ = '2009, Gerhard Aigner <gerhard.aigner at gmail.com>'
@ -10,30 +11,20 @@ import re
from calibre.web.feeds.news import BasicNewsRecipe from calibre.web.feeds.news import BasicNewsRecipe
class DiePresseRecipe(BasicNewsRecipe): class DiePresseRecipe(BasicNewsRecipe):
title = u'diePresse' title = 'Die Presse'
__author__ = 'Gerhard Aigner' __author__ = 'Gerhard Aigner'
description = u'DiePresse.com - Die Online-Ausgabe der Österreichischen Tageszeitung Die Presse.' description = 'DiePresse.com - Die Online-Ausgabe der Österreichischen Tageszeitung Die Presse.'
publisher ='DiePresse.com' publisher = 'Die Presse Verlags-Gesellschaft m.b.H. Co KG'
language = 'de_AT'
category = 'news, politics, nachrichten, Austria' category = 'news, politics, nachrichten, Austria'
use_embedded_content = False use_embedded_content = False
remove_empty_feeds = True remove_empty_feeds = True
lang = 'de-AT'
no_stylesheets = True no_stylesheets = True
encoding = 'ISO-8859-1'
language = 'de'
recursions = 0 recursions = 0
oldest_article = 1 oldest_article = 1
max_articles_per_feed = 100 max_articles_per_feed = 100
html2lrf_options = [
'--comment' , description
, '--category' , category
, '--publisher', publisher
]
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
preprocess_regexps = [ preprocess_regexps = [
(re.compile(r'Textversion', re.DOTALL), lambda match: ''), (re.compile(r'Textversion', re.DOTALL), lambda match: ''),
] ]
@ -47,27 +38,26 @@ class DiePresseRecipe(BasicNewsRecipe):
dict(name='a', attrs={'class':'print'}), dict(name='a', attrs={'class':'print'}),
dict(name='div', attrs={'class':'hline'})] dict(name='div', attrs={'class':'hline'})]
feeds = [(u'Politik', u'http://diepresse.com/rss/Politik'), remove_tags_after = [
(u'Wirtschaft', u'http://diepresse.com/rss/Wirtschaft'), dict(name='div', attrs={'class':'articletext'})
(u'Europa', u'http://diepresse.com/rss/EU'), ]
(u'Panorama', u'http://diepresse.com/rss/Panorama'),
(u'Sport', u'http://diepresse.com/rss/Sport'), feeds = [
(u'Kultur', u'http://diepresse.com/rss/Kultur'), ('Politik', 'http://diepresse.com/rss/Politik'),
(u'Leben', u'http://diepresse.com/rss/Leben'), ('Wirtschaft', 'http://diepresse.com/rss/Wirtschaft'),
(u'Tech', u'http://diepresse.com/rss/Tech'), ('Europa', 'http://diepresse.com/rss/EU'),
(u'Wissenschaft', u'http://diepresse.com/rss/Science'), ('Panorama', 'http://diepresse.com/rss/Panorama'),
(u'Bildung', u'http://diepresse.com/rss/Bildung'), ('Sport', 'http://diepresse.com/rss/Sport'),
(u'Gesundheit', u'http://diepresse.com/rss/Gesundheit'), ('Kultur', 'http://diepresse.com/rss/Kultur'),
(u'Recht', u'http://diepresse.com/rss/Recht'), ('Leben', 'http://diepresse.com/rss/Leben'),
(u'Spectrum', u'http://diepresse.com/rss/Spectrum'), ('Tech', 'http://diepresse.com/rss/Tech'),
(u'Meinung', u'http://diepresse.com/rss/Meinung')] ('Wissenschaft', 'http://diepresse.com/rss/Science'),
('Bildung', 'http://diepresse.com/rss/Bildung'),
('Gesundheit', 'http://diepresse.com/rss/Gesundheit'),
('Recht', 'http://diepresse.com/rss/Recht'),
('Spectrum', 'http://diepresse.com/rss/Spectrum'),
('Meinung', 'http://diepresse.com/rss/Meinung')
]
def print_version(self, url): def print_version(self, url):
return url.replace('home','text/home') return url.replace('home','text/home')
def preprocess_html(self, soup):
soup.html['xml:lang'] = self.lang
soup.html['lang'] = self.lang
mtag = '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'
soup.head.insert(0,mtag)
return soup