Skip to content

Instantly share code, notes, and snippets.

@dance2die
Created June 16, 2018 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dance2die/342880490bd1d274625bcc928b6ca358 to your computer and use it in GitHub Desktop.
Save dance2die/342880490bd1d274625bcc928b6ca358 to your computer and use it in GitHub Desktop.
Get top level Hacker News API data
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