Twitch TV Account Logo Doesn't Show Up

Twitch TV Account Logo Doesn't Show Up
0

#1

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!


#2

The logo is in the object you get back from the Kraken API if that streamer is online (data.logo). You’re going to have to supply a user logo for streamers who are not online. I would also drop that external library. The channels API should provide everything you need for a list of users.