Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get the most recent stories on HackerNews
import sys
from hn import HN
hn = HN()
print "Enter number of stories you'd like to view: "
n = raw_input()
while not n.isdigit():
print "Enter an integer: "
n = raw_input()
n = int(n)
for story in list(hn.get_stories(story_type="newest", limit=n))[:n]:
print(story.rank, story.title)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment