Commits

Anonymous committed 143b945

major bugfix: badly assigned same hn_url to all stories

  • Participants
  • Parent commits 1c72fac

Comments (0)

Files changed (1)

File hackernews.py

             days = 0
         date_posted = (datetime.datetime.now() + datetime.timedelta(days=-int(days))).strftime('%Y-%m-%d')
         story_meta.append({'date_posted': date_posted, 'hn_url': hn_url})
-        i = 0
-
+    
+    i = 0
     for story in stories:
         title = J(story).text()
         url = J('a', story).attr('href')
                 'date_posted': story_meta[i]['date_posted'],
                 'hn_url': story_meta[i]['hn_url'],
             })
+            i += 1
 
     # If we're getting all saved stories.
     if kwargs.get('all'):