diff --git a/hn.py b/hn.py index 017dba1..8c5c6ae 100755 --- a/hn.py +++ b/hn.py @@ -26,13 +26,13 @@ def main(stdscr): stdscr.clear() height, width = stdscr.getmaxyx() - num_stories = curses.LINES - 2 # headline and detail + num_stories = curses.LINES - 3 # headline, detail, footer # Query Hacker News API for top stories and their titles/links url = 'https://hacker-news.firebaseio.com/v0/topstories.json' r = requests.get(url) if not r.ok: raise Exception('Error fetching data from Hacker News API') - ids = r.json()[:10] + ids = r.json()[:num_stories] stories = [] for idx, i in enumerate(ids): stdscr.clear()