mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Kurier
This commit is contained in:
parent
ecc428c98b
commit
fdd5a99328
@ -1,9 +1,15 @@
|
|||||||
|
#!/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__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
|
||||||
'''
|
'''
|
||||||
kurier.at
|
kurier.at
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
import re
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class Kurier(BasicNewsRecipe):
|
class Kurier(BasicNewsRecipe):
|
||||||
@ -15,13 +21,11 @@ class Kurier(BasicNewsRecipe):
|
|||||||
oldest_article = 2
|
oldest_article = 2
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
timeout = 30
|
timeout = 30
|
||||||
encoding = None
|
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
language = 'de_AT'
|
language = 'de_AT'
|
||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
publication_type = 'newspaper'
|
publication_type = 'newspaper'
|
||||||
extra_css = ' body{font-family: Verdana,Helvetica,sans-serif } img{margin-bottom: 0.4em} .bild_us{font-size: x-small} '
|
|
||||||
|
|
||||||
conversion_options = {
|
conversion_options = {
|
||||||
'comment' : description
|
'comment' : description
|
||||||
@ -30,22 +34,31 @@ class Kurier(BasicNewsRecipe):
|
|||||||
, 'language' : language
|
, 'language' : language
|
||||||
}
|
}
|
||||||
|
|
||||||
remove_tags = [ dict(attrs={'id':['artikel_expand_symbol2','imgzoom_close2']}),
|
|
||||||
dict(attrs={'class':['linkextern','functionsleiste','functions','social_positionierung','contenttabs','drucken','versenden','leserbrief','kommentieren','addthis_button']})
|
|
||||||
]
|
|
||||||
keep_only_tags = [dict(attrs={'id':'content'})]
|
|
||||||
remove_tags_after = [dict(attrs={'id':'author'})]
|
|
||||||
remove_attributes = ['width','height']
|
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
(u'Nachrichten', u'http://kurier.at/rss/nachrichten_nachrichten_rss.xml' )
|
('Politik', 'http://kurier.at/politik/xml/rss'),
|
||||||
,(u'Techno' , u'http://kurier.at/rss/techno_techno_rss.xml' )
|
('Wirtschaft', 'http://kurier.at/wirtschaft/xml/rss'),
|
||||||
,(u'Wirtschaft' , u'http://kurier.at/rss/wirtschaft_wirtschaft_rss.xml' )
|
('Chronik', 'http://kurier.at/chronik/xml/rss'),
|
||||||
,(u'Kultur' , u'http://kurier.at/rss/kultur_kultur_rss.xml' )
|
('Kultur', 'http://kurier.at/kultur/xml/rss'),
|
||||||
,(u'Freizeit' , u'http://kurier.at/rss/freizeit_freizeit_rss.xml' )
|
('Leben', 'http://kurier.at/leben/xml/rss'),
|
||||||
,(u'Wetter' , u'http://kurier.at/rss/oewetter_rss.xml' )
|
('Menschen', 'http://kurier.at/menschen/xml/rss'),
|
||||||
,(u'Sport' , u'http://kurier.at/newsfeed/detail/sport_rss.xml' )
|
('Sport', 'http://kurier.at/sport/xml/rss')
|
||||||
]
|
]
|
||||||
|
|
||||||
|
keep_only_tags = [
|
||||||
|
dict(name='article', attrs={'class':re.compile('main-article')})
|
||||||
|
]
|
||||||
|
|
||||||
|
remove_tags = [
|
||||||
|
dict(name='div', attrs={'class':'social-media-container'}),
|
||||||
|
dict(name='section', attrs={'class':'tags'}),
|
||||||
|
dict(name='section', attrs={'class':re.compile('comment-box')}),
|
||||||
|
dict(name='section', attrs={'class':re.compile('related-content')}),
|
||||||
|
dict(name='section', attrs={'class':re.compile('article-slider')}),
|
||||||
|
dict(name='section', attrs={'class':re.compile('commentcontainer')}),
|
||||||
|
dict(name='blockquote')
|
||||||
|
]
|
||||||
|
|
||||||
|
remove_attributes = ['width','height']
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for item in soup.findAll(style=True):
|
for item in soup.findAll(style=True):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user