Skip to content

Instantly share code, notes, and snippets.

@rbren
Last active September 29, 2017 17:51
Show Gist options
  • Save rbren/6aa1bb21dd3d6304c850d6ea673a7c3b to your computer and use it in GitHub Desktop.
Save rbren/6aa1bb21dd3d6304c850d6ea673a7c3b to your computer and use it in GitHub Desktop.
// Note: this code doesn't work!
let hn = require('@datafire/hacker_news').create();
let storyIDs = hn.getStories({storyType: 'top'});
let topStory = 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