Fix Spiegel Online International

This commit is contained in:
Kovid Goyal 2012-05-15 18:35:42 +05:30
parent 8eebae3bf5
commit 4f2f8e2540

View File

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