mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Pull from trunk
This commit is contained in:
commit
f969ed39fe
@ -1,5 +1,4 @@
|
|||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
'''Read meta information from PDF files'''
|
'''Read meta information from PDF files'''
|
||||||
|
BIN
src/calibre/gui2/images/news/diepresse.png
Normal file
BIN
src/calibre/gui2/images/news/diepresse.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 637 B |
@ -1,18 +1,42 @@
|
|||||||
import re
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Gerhard Aigner <gerhard.aigner at gmail.com>'
|
||||||
|
|
||||||
|
''' http://www.diepresse.at - Austrian Newspaper '''
|
||||||
|
|
||||||
|
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 = u'diePresse'
|
||||||
|
__author__ = 'Gerhard Aigner'
|
||||||
|
description = u'DiePresse.com - Die Online-Ausgabe der Österreichischen Tageszeitung Die Presse.'
|
||||||
|
publisher ='DiePresse.com'
|
||||||
|
category = 'news, politics, nachrichten, Austria'
|
||||||
|
use_embedded_content = False
|
||||||
|
remove_empty_feeds = True
|
||||||
|
lang = 'de-AT'
|
||||||
|
no_stylesheets = True
|
||||||
|
encoding = 'ISO-8859-1'
|
||||||
|
language = _('German')
|
||||||
|
recursions = 0
|
||||||
oldest_article = 1
|
oldest_article = 1
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
recursions = 0
|
|
||||||
language = _('German')
|
html2lrf_options = [
|
||||||
__author__ = 'Gerhard Aigner'
|
'--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: ''),
|
||||||
]
|
]
|
||||||
|
|
||||||
remove_tags = [dict(name='hr'),
|
remove_tags = [dict(name='hr'),
|
||||||
dict(name='br'),
|
dict(name='br'),
|
||||||
dict(name='small'),
|
dict(name='small'),
|
||||||
@ -21,6 +45,7 @@ class DiePresseRecipe(BasicNewsRecipe):
|
|||||||
dict(name='h1', attrs={'class':'titel'}),
|
dict(name='h1', attrs={'class':'titel'}),
|
||||||
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'),
|
feeds = [(u'Politik', u'http://diepresse.com/rss/Politik'),
|
||||||
(u'Wirtschaft', u'http://diepresse.com/rss/Wirtschaft'),
|
(u'Wirtschaft', u'http://diepresse.com/rss/Wirtschaft'),
|
||||||
(u'Europa', u'http://diepresse.com/rss/EU'),
|
(u'Europa', u'http://diepresse.com/rss/EU'),
|
||||||
@ -29,7 +54,7 @@ class DiePresseRecipe(BasicNewsRecipe):
|
|||||||
(u'Kultur', u'http://diepresse.com/rss/Kultur'),
|
(u'Kultur', u'http://diepresse.com/rss/Kultur'),
|
||||||
(u'Leben', u'http://diepresse.com/rss/Leben'),
|
(u'Leben', u'http://diepresse.com/rss/Leben'),
|
||||||
(u'Tech', u'http://diepresse.com/rss/Tech'),
|
(u'Tech', u'http://diepresse.com/rss/Tech'),
|
||||||
(u'Science', u'http://diepresse.com/rss/Science'),
|
(u'Wissenschaft', u'http://diepresse.com/rss/Science'),
|
||||||
(u'Bildung', u'http://diepresse.com/rss/Bildung'),
|
(u'Bildung', u'http://diepresse.com/rss/Bildung'),
|
||||||
(u'Gesundheit', u'http://diepresse.com/rss/Gesundheit'),
|
(u'Gesundheit', u'http://diepresse.com/rss/Gesundheit'),
|
||||||
(u'Recht', u'http://diepresse.com/rss/Recht'),
|
(u'Recht', u'http://diepresse.com/rss/Recht'),
|
||||||
@ -38,3 +63,10 @@ class DiePresseRecipe(BasicNewsRecipe):
|
|||||||
|
|
||||||
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
|
Loading…
x
Reference in New Issue
Block a user