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