Fix #830800 (fix #760384 not applied to both WSJ recipes)

This commit is contained in:
Kovid Goyal 2011-08-21 20:48:11 -06:00
parent 0e4e082ed7
commit b22f38d71b

View File

@ -53,6 +53,12 @@ class WallStreetJournal(BasicNewsRecipe):
return soup return soup
def abs_wsj_url(self, href):
if not href.startswith('http'):
href = 'http://online.wsj.com' + href
return href
def wsj_get_index(self): def wsj_get_index(self):
return self.index_to_soup('http://online.wsj.com/itp') return self.index_to_soup('http://online.wsj.com/itp')
@ -83,14 +89,14 @@ class WallStreetJournal(BasicNewsRecipe):
pageone = a['href'].endswith('pageone') pageone = a['href'].endswith('pageone')
if pageone: if pageone:
title = 'Front Section' title = 'Front Section'
url = 'http://online.wsj.com' + a['href'] url = self.abs_wsj_url(a['href'])
feeds = self.wsj_add_feed(feeds,title,url) feeds = self.wsj_add_feed(feeds,title,url)
title = 'What''s News' title = 'What''s News'
url = url.replace('pageone','whatsnews') url = url.replace('pageone','whatsnews')
feeds = self.wsj_add_feed(feeds,title,url) feeds = self.wsj_add_feed(feeds,title,url)
else: else:
title = self.tag_to_string(a) title = self.tag_to_string(a)
url = 'http://online.wsj.com' + a['href'] url = self.abs_wsj_url(a['href'])
feeds = self.wsj_add_feed(feeds,title,url) feeds = self.wsj_add_feed(feeds,title,url)
return feeds return feeds
@ -146,7 +152,7 @@ class WallStreetJournal(BasicNewsRecipe):
title = self.tag_to_string(a).strip() + ' [%s]'%meta title = self.tag_to_string(a).strip() + ' [%s]'%meta
else: else:
title = self.tag_to_string(a).strip() title = self.tag_to_string(a).strip()
url = 'http://online.wsj.com'+a['href'] url = self.abs_wsj_url(a['href'])
desc = '' desc = ''
for p in container.findAll('p'): for p in container.findAll('p'):
desc = self.tag_to_string(p) desc = self.tag_to_string(p)