fix comments being wrong
This commit is contained in:
parent
32d57e605a
commit
58b6492b4d
3
api.py
3
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()
|
||||
|
Loading…
Reference in New Issue
Block a user