We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f1a5cf commit 78abd6bCopy full SHA for 78abd6b
web_programming/get_top_hn_posts.py
@@ -11,7 +11,7 @@ def hackernews_top_stories(max_stories: int = 10) -> dict:
11
12
top_stories = "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
13
14
- top_10 = requests.get(top_stories).json()[:10]
+ top_10 = requests.get(top_stories).json()[:max_stories]
15
16
table_data = [
17
["Title", "URL"],
@@ -32,4 +32,4 @@ def hackernews_top_stories(max_stories: int = 10) -> dict:
32
33
34
if __name__ == "__main__":
35
- stories()
+ hackernews_top_stories()
0 commit comments