This commit is contained in:
Kovid Goyal 2010-01-14 12:53:43 -07:00
parent b231920841
commit d2bbfc22c6

View File

@ -42,7 +42,7 @@ class ZeitDe(BasicNewsRecipe):
.headline iconportrait_inline{font-family:Arial,Helvetica,sans-serif;font-size:x-small} .headline iconportrait_inline{font-family:Arial,Helvetica,sans-serif;font-size:x-small}
''' '''
#filter_regexps = [r'ad.de.doubleclick.net/'] #filter_regexps = [r'ad.de.doubleclick.net/']
keep_only_tags = [ keep_only_tags = [
dict(name='div', attrs={'class':["article"]}) , dict(name='div', attrs={'class':["article"]}) ,
] ]
@ -52,32 +52,32 @@ class ZeitDe(BasicNewsRecipe):
dict(name='div', attrs={'id':["place_5","place_4"]}) dict(name='div', attrs={'id':["place_5","place_4"]})
] ]
def get_article_url(self, article): def get_article_url(self, article):
ans = article.get('guid',None) ans = article.get('guid',None)
try: try:
self.log('Looking for full story link in', ans) self.log('Looking for full story link in', ans)
soup = self.index_to_soup(ans) soup = self.index_to_soup(ans)
x = soup.find(text="Auf einer Seite lesen") x = soup.find(text="Auf einer Seite lesen")
if x is not None: if x is not None:
a = x.parent a = x.parent
if a and a.has_key('href'): if a and a.has_key('href'):
ans = a['href'] ans = a['href']
self.log('Found full story link', ans) self.log('Found full story link', ans)
except: except:
pass pass
if 'video' in ans or 'quiz' in ans : if 'video' in ans or 'quiz' in ans :
ans = None ans = None
return ans return ans
def preprocess_html(self, soup): def preprocess_html(self, soup):
soup.html['xml:lang'] = self.lang soup.html['xml:lang'] = self.lang
@ -87,7 +87,7 @@ class ZeitDe(BasicNewsRecipe):
return soup return soup
#def print_version(self,url): #def print_version(self,url):
# return url.replace('http://www.zeit.de/', 'http://images.zeit.de/text/').replace('?from=rss', '') # return url.replace('http://www.zeit.de/', 'http://images.zeit.de/text/').replace('?from=rss', '')