mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix Spiegel Online International
This commit is contained in:
parent
8eebae3bf5
commit
4f2f8e2540
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2008-2011, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2008-2011, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
@ -15,6 +16,8 @@ class Spiegel_int(BasicNewsRecipe):
|
|||||||
language = 'en_DE'
|
language = 'en_DE'
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
use_embedded_content = False
|
use_embedded_content = False
|
||||||
|
auto_cleanup = True
|
||||||
|
auto_cleanup_keep = '//*[@id="spArticleTopAsset"]'
|
||||||
encoding = 'cp1252'
|
encoding = 'cp1252'
|
||||||
publisher = 'SPIEGEL ONLINE GmbH'
|
publisher = 'SPIEGEL ONLINE GmbH'
|
||||||
category = 'news, politics, Germany'
|
category = 'news, politics, Germany'
|
||||||
@ -43,25 +46,25 @@ class Spiegel_int(BasicNewsRecipe):
|
|||||||
.spPhotoGallery{font-size:x-small; color:#990000 ;}
|
.spPhotoGallery{font-size:x-small; color:#990000 ;}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
keep_only_tags = [dict(attrs={'id':'spArticleContent'})]
|
#keep_only_tags = [dict(attrs={'id':'spArticleContent'})]
|
||||||
remove_tags_after = dict(attrs={'id':'spArticleBody'})
|
#remove_tags_after = dict(attrs={'id':'spArticleBody'})
|
||||||
remove_tags = [dict(name=['meta','base','iframe','embed','object'])]
|
#remove_tags = [dict(name=['meta','base','iframe','embed','object'])]
|
||||||
remove_attributes = ['clear']
|
#remove_attributes = ['clear']
|
||||||
feeds = [(u'Spiegel Online', u'http://www.spiegel.de/international/index.rss')]
|
feeds = [(u'Spiegel Online', u'http://www.spiegel.de/international/index.rss')]
|
||||||
|
|
||||||
def print_version(self, url):
|
#def print_version(self, url):
|
||||||
main, sep, rest = url.rpartition(',')
|
#main, sep, rest = url.rpartition(',')
|
||||||
rmain, rsep, rrest = main.rpartition(',')
|
#rmain, rsep, rrest = main.rpartition(',')
|
||||||
return rmain + ',druck-' + rrest + ',' + rest
|
#return rmain + ',druck-' + rrest + ',' + rest
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
#def preprocess_html(self, soup):
|
||||||
for item in soup.findAll(style=True):
|
#for item in soup.findAll(style=True):
|
||||||
del item['style']
|
#del item['style']
|
||||||
for item in soup.findAll('a'):
|
#for item in soup.findAll('a'):
|
||||||
if item.string is not None:
|
#if item.string is not None:
|
||||||
str = item.string
|
#str = item.string
|
||||||
item.replaceWith(str)
|
#item.replaceWith(str)
|
||||||
else:
|
#else:
|
||||||
str = self.tag_to_string(item)
|
#str = self.tag_to_string(item)
|
||||||
item.replaceWith(str)
|
#item.replaceWith(str)
|
||||||
return soup
|
#return soup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user