mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
New recipe for NZZ Online by Darko Miletic
This commit is contained in:
parent
bbcc9d4614
commit
d8ed8c0c07
BIN
src/calibre/gui2/images/news/nzz_ger.png
Normal file
BIN
src/calibre/gui2/images/news/nzz_ger.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 811 B |
@ -39,7 +39,7 @@ recipe_modules = ['recipe_' + r for r in (
|
|||||||
'nacional_cro', '24sata', 'dnevni_avaz', 'glas_srpske', '24sata_rs',
|
'nacional_cro', '24sata', 'dnevni_avaz', 'glas_srpske', '24sata_rs',
|
||||||
'krstarica', 'krstarica_en', 'tanjug', 'laprensa_ni', 'azstarnet',
|
'krstarica', 'krstarica_en', 'tanjug', 'laprensa_ni', 'azstarnet',
|
||||||
'corriere_della_sera_it', 'corriere_della_sera_en', 'msdnmag_en',
|
'corriere_della_sera_it', 'corriere_della_sera_en', 'msdnmag_en',
|
||||||
'moneynews', 'der_standard', 'diepresse',
|
'moneynews', 'der_standard', 'diepresse', 'nzz_ger',
|
||||||
)]
|
)]
|
||||||
|
|
||||||
import re, imp, inspect, time, os
|
import re, imp, inspect, time, os
|
||||||
|
66
src/calibre/web/feeds/recipes/recipe_nzz_ger.py
Normal file
66
src/calibre/web/feeds/recipes/recipe_nzz_ger.py
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
|
||||||
|
'''
|
||||||
|
www.nzz.ch
|
||||||
|
'''
|
||||||
|
|
||||||
|
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||||
|
|
||||||
|
class Nzz(BasicNewsRecipe):
|
||||||
|
title = 'NZZ Online'
|
||||||
|
__author__ = 'Darko Miletic'
|
||||||
|
description = 'Laufend aktualisierte Nachrichten, Analysen und Hintergruende zu Politik, Wirtschaft, Kultur und Sport'
|
||||||
|
publisher = 'NZZ AG'
|
||||||
|
category = 'news, politics, nachrichten, Switzerland'
|
||||||
|
oldest_article = 2
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
no_stylesheets = True
|
||||||
|
encoding = 'utf-8'
|
||||||
|
use_embedded_content = False
|
||||||
|
lang = 'de-CH'
|
||||||
|
language = _('German')
|
||||||
|
|
||||||
|
html2lrf_options = [
|
||||||
|
'--comment', description
|
||||||
|
, '--category', category
|
||||||
|
, '--publisher', publisher
|
||||||
|
]
|
||||||
|
|
||||||
|
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\noverride_css=" p {text-indent: 0em; margin-top: 0em; margin-bottom: 0.5em} img {margin-top: 0em; margin-bottom: 0.4em}"'
|
||||||
|
|
||||||
|
keep_only_tags = [dict(name='div', attrs={'class':'article'})]
|
||||||
|
|
||||||
|
remove_tags = [
|
||||||
|
dict(name=['object','link','base','script'])
|
||||||
|
,dict(name='div',attrs={'class':['more','teaser','advXertXoriXals','legal']})
|
||||||
|
,dict(name='div',attrs={'id':['popup-src','readercomments','google-ad','advXertXoriXals']})
|
||||||
|
]
|
||||||
|
|
||||||
|
feeds = [
|
||||||
|
(u'Neuste Artikel', u'http://www.nzz.ch/feeds/recent/' )
|
||||||
|
,(u'International' , u'http://www.nzz.ch/nachrichten/international?rss=true')
|
||||||
|
,(u'Schweiz' , u'http://www.nzz.ch/nachrichten/schweiz?rss=true')
|
||||||
|
,(u'Wirtschaft' , u'http://www.nzz.ch/nachrichten/wirtschaft/aktuell?rss=true')
|
||||||
|
,(u'Finanzmaerkte' , u'http://www.nzz.ch/finanzen/nachrichten?rss=true')
|
||||||
|
,(u'Zuerich' , u'http://www.nzz.ch/nachrichten/zuerich?rss=true')
|
||||||
|
,(u'Sport' , u'http://www.nzz.ch/nachrichten/sport?rss=true')
|
||||||
|
,(u'Panorama' , u'http://www.nzz.ch/nachrichten/panorama?rss=true')
|
||||||
|
,(u'Kultur' , u'http://www.nzz.ch/nachrichten/kultur/aktuell?rss=true')
|
||||||
|
,(u'Wissenschaft' , u'http://www.nzz.ch/nachrichten/wissenschaft?rss=true')
|
||||||
|
,(u'Medien' , u'http://www.nzz.ch/nachrichten/medien?rss=true')
|
||||||
|
,(u'Reisen' , u'http://www.nzz.ch/magazin/reisen?rss=true')
|
||||||
|
]
|
||||||
|
|
||||||
|
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=' + self.encoding + '">'
|
||||||
|
soup.head.insert(0,mtag)
|
||||||
|
return soup
|
||||||
|
|
||||||
|
def print_version(self, url):
|
||||||
|
return url + '?printview=true'
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user