I am working on the twitchTV project and I am currently able to get info from the API like I hoped to do, but for some reason, I cannot get the twitch account’s logo to show up in the preliminary buttons I am making to test out the code I’ve written so far.
Here is the JS:
$.getJSON('https://api.twitch.tv/kraken/channels/OgamingSC2?callback=?’, function(data) {
// console.log(data._links[“channel”]);
console.log(data)
console.log(data.game);
console.log(data.display_name);
console.log(data.status);
console.log(data.profile_banner);
$(".ac4").add(""+"").appendTo(".ac4"); // This doesn’t work
$("#freecodecamp").html("" +""); // this doesn’t work either
});
Here is the corresponding HTML:
http://pastebin.com/fgyzrz0R
(NOTE: I used an external library to find online/offline status - that is what is at the top of the html file, and that is why I have the img tags within the buttons inside the HTML)
Any tips on how I can get the logo for the account and the stream to both show up would be great! Am I approaching this task the wrong way? Any specific examples are welcome too!
Thanks!