Update WSJ to include A-hed article

This commit is contained in:
Kovid Goyal 2014-05-14 22:40:04 +05:30
parent f28ee68679
commit 6b4182da7b
2 changed files with 36 additions and 2 deletions

View File

@ -108,6 +108,23 @@ class WallStreetJournal(BasicNewsRecipe):
title = self.tag_to_string(a)
url = self.abs_wsj_url(a['href'])
feeds = self.wsj_add_feed(feeds,title,url)
for li in soup.findAll('li', attrs={'class':'ahed_listitem'}):
h2 = li.find('h2')
if h2 is None:
continue
a = h2.find('a', href=True)
if a is None:
continue
url = a['href']
title = self.tag_to_string(a)
p = h2.findNextSibling('p')
if p is not None:
desc = self.tag_to_string(p)
else:
desc = ''
if feeds:
feeds[0][1].append({'title':title, 'url':url, 'description':desc, 'date':''})
return feeds
def wsj_find_wn_articles(self, url):
@ -167,7 +184,7 @@ class WallStreetJournal(BasicNewsRecipe):
desc = ''
for p in container.findAll('p'):
desc = self.tag_to_string(p)
if not 'Subscriber Content' in desc:
if 'Subscriber Content' not in desc:
break
articles.append({'title':title, 'url':url,

View File

@ -91,6 +91,23 @@ class WallStreetJournal(BasicNewsRecipe):
title = self.tag_to_string(a)
url = self.abs_wsj_url(a['href'])
feeds = self.wsj_add_feed(feeds,title,url)
for li in soup.findAll('li', attrs={'class':'ahed_listitem'}):
h2 = li.find('h2')
if h2 is None:
continue
a = h2.find('a', href=True)
if a is None:
continue
url = a['href']
title = self.tag_to_string(a)
p = h2.findNextSibling('p')
if p is not None:
desc = self.tag_to_string(p)
else:
desc = ''
if feeds:
feeds[0][1].append({'title':title, 'url':url, 'description':desc, 'date':''})
return feeds
def wsj_find_wn_articles(self, url):
@ -149,7 +166,7 @@ class WallStreetJournal(BasicNewsRecipe):
desc = ''
for p in container.findAll('p'):
desc = self.tag_to_string(p)
if not 'Subscriber Content' in desc:
if 'Subscriber Content' not in desc:
break
articles.append({'title':title, 'url':url,