Skip to content

Instantly share code, notes, and snippets.

@rbren
Last active September 29, 2017 17:56
Show Gist options
  • Save rbren/258c0862060cccbc4aa2179d452b9fb7 to your computer and use it in GitHub Desktop.
Save rbren/258c0862060cccbc4aa2179d452b9fb7 to your computer and use it in GitHub Desktop.
// Note: this code doesn't work!
let hn = require('@datafire/hacker_news').create();
hn.getStories({storyType: 'top'}, (err, storyIDs) => {
if (err) throw err;
hn.getItem({itemID: storyIDs[0]}, (err, topStory) => {
if (err) throw err;
console.log(`Top story: ${topStory.title} - ${topStory.url}`);
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment