From 58b6492b4d32057ae84077266a06fbaff1a9043f Mon Sep 17 00:00:00 2001 From: Felix Pankratz Date: Wed, 30 Aug 2023 23:35:11 +0200 Subject: [PATCH] fix comments being wrong --- api.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api.py b/api.py index 65b51fe..6a3afe4 100644 --- a/api.py +++ b/api.py @@ -22,7 +22,6 @@ def get_topstories(): return r.json() async def get_story(session, story_id): - #story_url = f'https://hacker-news.firebaseio.com/v0/item/{story_id}.json' async with session.get(f'https://hacker-news.firebaseio.com/v0/item/{story_id}.json') as resp: s = await resp.json() #requests.get(story_url).json() return Story(s['id'], @@ -30,7 +29,7 @@ async def get_story(session, story_id): s['url'] if 'url' in s else 'No URL', s['by'], s['score'], - len(s['kids']) if 'kids' in s else 0, False) + s['descendants'] if 'descendants' in s else 0, False) def main(): ts = get_topstories()