Skip to content

Instantly share code, notes, and snippets.

@awareness481
Created June 17, 2017 19:09
Show Gist options
  • Save awareness481/45b2db842fdeca5aac8496dbd771abe9 to your computer and use it in GitHub Desktop.
Save awareness481/45b2db842fdeca5aac8496dbd771abe9 to your computer and use it in GitHub Desktop.
400, no client-id specified
const channels = "ESL_SC2, OgamingSC2, cretetion, freecodecamp, storbeck, habathcx, RobotCaleb, noobs2ninjas";
const end = `https://api.twitch.tv/kraken/streams/channel=${channels}`;
const streams = [];
const myHeaders = new Headers();
myHeaders.append("Client-Id", "lfy14565wb4omezslcd2a3unt3zcv9");
const init = {
method: 'GET',
Headers: myHeaders
};
fetch(end, init)
.then(blob => blob.json())
.then(data => streams.push(...data));
console.log(streams);
function displayStreams() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment