Hi everyone!
I realized with a little delay of the “migration” and my website widget stopped working all of a sudden.
I don’t understand much about coding, but I can show you what I used (and it worked fine).
Basically the widget warned with a text message if I was online, with which game and how many spectators; if I was offline it showed another message. That’s all.
$(function() {
var user_name = "channelName";
var userURL = 'https://api.twitch.tv/kraken/streams/ID(maybe?)';
twitch_widget = $("#twitch-widget");
twitch_widget.attr("href","http://twitch.tv/" + user_name);
$.ajax({
type: 'GET',
url: userURL,
dataType: 'json',
contentType: 'application/json',
headers: {
'Accept': 'application/vnd.twitchtv.v5+json',
'Client-ID': 'clientIDHere'
},
success: function(data) {
if (data.stream) {
twitch_widget.html("message <b>" + data.stream.game + "</b><span class='viewers'> message <b>" + data.stream.viewers + "</b> message</span></br><a id='openOverlay_js'><span class='online no-mobile'>message</span></a><a target='_blank' href='channelUrl'><span class='online-tv'>message</span></a>");
$('#apriOverlay_js').on('click',function(){
var link_="siteUrl/popStreaming.html";
overlay(link_);
return false;
});
} else {
twitch_widget.html("message<b>message</b></br><a target='_blank' href='channelUrl'><span class='offline'>message</span></a>");
}
}
});
});
Can you help me correct it with the right information?
Thank you a lot!