From b59c3778a39128e6ed222225b8659fbaf9ccff86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Fri, 21 Feb 2014 20:14:01 +0100 Subject: [PATCH] save link to last number in a variable instead of finding it out again and again --- recipes/gosc_full.recipe | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/gosc_full.recipe b/recipes/gosc_full.recipe index 5797c0419f..abb9c9b694 100644 --- a/recipes/gosc_full.recipe +++ b/recipes/gosc_full.recipe @@ -30,7 +30,8 @@ class GN(BasicNewsRecipe): return page[4] def parse_index(self): - soup = self.index_to_soup('http://gosc.pl' + self.find_last_issue()) + self.last_issue = self.find_last_issue() + soup = self.index_to_soup('http://gosc.pl' + self.last_issue) self.cover_url = 'http://www.gosc.pl' + soup.find('div',attrs={'class':'fl-w100 release-wp'}).findAll('a')[-4].contents[0]['src'] feeds = [] enlisted = [] @@ -57,7 +58,7 @@ class GN(BasicNewsRecipe): page = 1 not_assigned = [] while True: - soup = self.index_to_soup('http://gosc.pl' + self.find_last_issue().replace('przeglad','wszystko') + '/' + str(page)) + soup = self.index_to_soup('http://gosc.pl' + self.last_issue.replace('przeglad','wszystko') + '/' + str(page)) articles = list(self.find_articles(soup)) not_assigned.extend([x for x in articles if x.get('url') not in enlisted]) page+=1