Top 10 Story Titles
async with HackerNews() as hn:
ids = await hn.top()
stories = await hn.items(ids[:10])
for story in stories:
print(story.title)
Most Recent Stories
async with HackerNews() as hn:
ids = await hn.new()
for item in await hn.items(ids[:20]):
print(item.title)
User Lookup
async with HackerNews() as hn:
user = await hn.user("pg")
print(user.karma)
Thread Explorer
async with HackerNews() as hn:
thread = await hn.thread(story_id)
print(thread.root.title)
print(thread.comment_count)