add articles' descriptions and dates

This commit is contained in:
Tomasz Długosz 2014-02-18 21:42:02 +01:00
parent 13ad540a05
commit c54d832d06

View File

@ -31,10 +31,12 @@ class GN(BasicNewsRecipe):
self.cover_url = 'http://www.gosc.pl' + soup.find('div',attrs={'class':'fl-w100 release-wp'}).findAll('a')[-4].contents[0]['src']
feeds = []
# wstepniak
a = soup.find('div',attrs={'class':'release-wp-b'}).find('a')
a = soup.find('div',attrs={'class':'release-wp-b'})
art = a.find('a')
articles = [
{'title' : self.tag_to_string(a),
'url' : 'http://www.gosc.pl' + a['href']
{'title' : self.tag_to_string(art),
'url' : 'http://www.gosc.pl' + art['href'],
'description' : self.tag_to_string(a.find('p',attrs={'class':'b lead'}))
}]
feeds.append((u'Wstępniak',articles))
# kategorie
@ -52,7 +54,9 @@ class GN(BasicNewsRecipe):
art = a.find('a')
yield {
'title' : self.tag_to_string(art),
'url' : 'http://www.gosc.pl' + art['href']
'url' : 'http://www.gosc.pl' + art['href'],
'date' : self.tag_to_string(a.find('p', attrs={'class':'sr-date'})),
'description' : self.tag_to_string(a.find('p', attrs={'class':'sr-lead'}))
}
def append_page(self, soup, appendtag):