Streamers live status on website

 Hello guys, I am working on my own IPB forum and I am trying to create a list with streamers (about 5) and their status.

 I am pretty sure that there are many request like this one, but  everything I found is old and not working.

Here are some examples I found in internet, but couldnt make em work:

http://jsfiddle.net/LYv3R/634/

http://jsfiddle.net/LYv3R/635/

Both are showing offline, even if the streamer is online.

Thank you friends.

Neither of those scripts is sending the required client ID.

1 Like

I read that topic : https://blog.twitch.tv/client-id-required-for-kraken-api-calls-afbb8e95f843#.h4pvaom5p
and it says “Add the Client-ID to the header of your request.”

I got my Client ID, but dont know how to build the full code:

http://jsfiddle.net/LYv3R/638/

This works for me:

HTML:

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>

JS:

$.getJSON("https://api.twitch.tv/kraken/streams/illusionaryone?client_id=my_client_id", function(c) {
  if (c.stream == null) {
    console.log("Offline");
  } else {
    console.log("Online");
  }
});

I believe you may need to include your client_id on the request as well, I didn’t try using your entire script though.

1 Like

Thank you so much man. I made it work.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.