Created
June 16, 2018 13:53
-
-
Save dance2die/342880490bd1d274625bcc928b6ca358 to your computer and use it in GitHub Desktop.
Get top level Hacker News API data
This file contains 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
const topStoriesURL = `https://hacker-news.firebaseio.com/v0/topstories.json` | |
const newStoriesURL = `https://hacker-news.firebaseio.com/v0/newstories.json` | |
const bestStoriesURL = `https://hacker-news.firebaseio.com/v0/beststories.json` | |
const getItemURL = storyId => | |
`https://hacker-news.firebaseio.com/v0/item/${storyId}.json` | |
const topResults = await axios.get(topStoriesURL) | |
const newResults = await axios.get(newStoriesURL) | |
const bestResults = await axios.get(bestStoriesURL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment