i dont understand where m going wrong…its only a partial code…after showing the online channels…it repeats the RobotCaleb in the array instead of showing all distinct names and their status
var streamers=[“HardlyDifficult”, “ESL_SC2”, “OgamingSC2”, “adobe”, “cretetion”, “freecodecamp”, “storbeck”, “habathcx”, “RobotCaleb”];
var logo="";
var name="";
var status="";
var URL="";
var channel=“https://wind-bow.gomix.me/twitch-api/channels/”;
var streams=“https://wind-bow.gomix.me/twitch-api/streams/”;
for (var i = 0; i < streamers.length; i++) {
var channelURL=channel+streamers[i]+"?callback=?";
var streamsURL=streams+streamers[i]+"?callback=?";
.getJSON(streamsURL,function(data1){
if (data1.stream==null) {
.getJSON(channelURL,function(data2){
getOffline(data2);
setData();
});
}
else
{
getOnline(data1);
setData();
}
});
}
function getOnline(on){
logo=on.stream.channel.logo;
name=on.stream.channel.name;
status=on.stream.game;
URL=on.stream.channel.url;
}
function getOffline(off){
logo=off.logo;
name=off.name;
status=“Offline”;
URL=off.url;
}
function setData(){$(".content").append("
"+name+"
"+status+"
}