MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / get_hackernews_story

Function get_hackernews_story

web_programming/get_top_hn_posts.py:13–15  ·  view source on GitHub ↗
(story_id: str)

Source from the content-addressed store, hash-verified

11
12
13def get_hackernews_story(story_id: str) -> dict:
14 url = f"https://hacker-news.firebaseio.com/v0/item/{story_id}.json?print=pretty"
15 return httpx.get(url, timeout=10).json()
16
17
18def hackernews_top_stories(max_stories: int = 10) -> list[dict]:

Callers 1

hackernews_top_storiesFunction · 0.85

Calls 2

jsonMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected