Skip to content

Commit 78abd6b

Browse files
authored
Update get_top_hn_posts.py
1 parent 2f1a5cf commit 78abd6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web_programming/get_top_hn_posts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def hackernews_top_stories(max_stories: int = 10) -> dict:
1111

1212
top_stories = "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
1313

14-
top_10 = requests.get(top_stories).json()[:10]
14+
top_10 = requests.get(top_stories).json()[:max_stories]
1515

1616
table_data = [
1717
["Title", "URL"],
@@ -32,4 +32,4 @@ def hackernews_top_stories(max_stories: int = 10) -> dict:
3232

3333

3434
if __name__ == "__main__":
35-
stories()
35+
hackernews_top_stories()

0 commit comments

Comments
 (0)