Last active
September 29, 2017 17:56
-
-
Save rbren/258c0862060cccbc4aa2179d452b9fb7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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