Twitch-Channel-Status icon indicating copy to clipboard operation
Twitch-Channel-Status copied to clipboard

Script dont working with actual API

Open fabki opened this issue 8 years ago • 4 comments

Is there a possibility to change the script to work with the actual API?

https://blog.twitch.tv/client-id-required-for-kraken-api-calls-afbb8e95f843#.mb57f5w8c

So simply adding " headers: {"Client-ID": "yourclientidhere"}, " to the request don't work.

// Ask twitch for the status of all channels at once $.ajax({ headers: {"Client-ID": "yourclientidhere"}, url: "https://api.twitch.tv/kraken/streams", data: {"channel": Object.keys(channels).join(","), "limit": Object.keys(channels).length}, cache: false, dataType: "jsonp" }).done(function (data) { // We can only handle 100 online channels at a time :( if (data.streams.length < data._total) { console.warn("refreshTwitchChannelStatuses couldn't load all online channels! Please reduce the number of channels you are trying to check."); }

fabki avatar Nov 28 '16 16:11 fabki

aye, this script recently stopped working...

blizam avatar Dec 01 '16 22:12 blizam

Twitch made all calls to the API under 'kraken' path require 'client id'; For details, check out https://blog.twitch.tv/client-id-required-for-kraken-api-calls-afbb8e95f843#.1nqjlhs8h

to fix this library, it probably needs to be modified to accept a new <script> attribute, like data-clientid, and the single ajax like has to have the data payload include the clientid. it would not work right out of the box, but it could also include a console.log message if there is garbage/missing clientid

robbiemu avatar Dec 14 '16 19:12 robbiemu

bump

chuckreynolds avatar Feb 23 '17 23:02 chuckreynolds

bump, any clean way to do this in a single .js found yet?

also for reference: https://discuss.dev.twitch.tv/t/announce-when-my-channel-is-live-on-my-website-in-an-html-element-using-js/22648

calexil avatar Sep 27 '19 20:09 calexil