Skip to content

Instantly share code, notes, and snippets.

@rbren
Last active October 11, 2017 15:47
Show Gist options
  • Save rbren/a259eb7b06e049fd1bb5774733c80eee to your computer and use it in GitHub Desktop.
Save rbren/a259eb7b06e049fd1bb5774733c80eee to your computer and use it in GitHub Desktop.
let hn = require('@datafire/hacker_news').create();
(async () => {
let storyIDs = await hn.getStories({storyType: 'top'});
let topStory = await hn.getItem({itemID: storyIDs[0]});
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