freeCodeCamp Challenge Guide: How to Use the TwitchTV API

freeCodeCamp Challenge Guide: How to Use the TwitchTV API
0

#63

Hello guys Iam trying to call the twitch api and i get 0 in the console …
var xhr = new XMLHttpRequest();
xhr.open(“GET”, “https://wind-bow.gomix.me/twitch-api”, true);
xhr.send();
xhr.status;
console.log(xhr.status);
console.log (xhr.statusText);


#64

Hey guys I’ve just completed it https://codepen.io/c0d3g0d/full/awBNoo/

It works fine but I need your feedback.


#65

The JSONP method is no longer applicable as twitch requires a api key now


#66

Hey guys,
I’m currently using Flexbox to play around with alignment, but I’m having a hard time getting it to work.

I’m trying to fit my logo and my two other paragraphs to fit inside the flex container in a row, but it keeps ending up in a column. The internet has been telling me to put it on flex-direction, justify-content etc. but it’s still not working…Any help would be great!!!

I’m also a very, very beginner at this while working on it on and off due to full time work.

Thank you,

Link below:
Twitch Api


#67

Hey all,
I have just started this challenge and was struggling to figure out a way to pull the data from the Twitch TV API. What I was able to find out is that as of last year, they now require you to have a client ID key. As a result, this now means that you have to go to the Twitch TV website (https://dev.twitch.tv/get-started), and click on Create a Twitch Account(https://twitch.tv/signup). Once this is done, in the top right hand corner of the page, click on your username, and go to settings. From here, verify your email and then click on the connections tab.

Under the connections tab, scroll right to the bottom and click on register your application. Follow the instructions on there and at the end, you will be given a client ID key.
(for the website, I literally just linked the codepen I am using to make this work)

After this, on the Twitch website, they said an easy way to make an API call using JQuery is just to use this:

$(document).ready(function(){

$.ajax({
	type: 'GET',
	url: 'https://api.twitch.tv/kraken/channels/twitch',
	headers: {
	'Client-ID': 'your key here'
	},
	 success: function(data) {
	   console.log(data);
	 }
});

});

inspect the element and you should find the data has been called successfully!

Happy coding!


#68

Hi csapty12, while this is a good solution in general where your code is private, it’s really not a good idea to publicly broadcast your api key. i.e. put it in a codepen where the whole world can see it. This is a general rule for any api you’ll be working with.


#69

It seems Good but you need to consider color selection at the head.


#71