Well, my Challenge is almost over, everything is done, but I can’t yet find out when an account is closed and when is only offline. I’d appreciate any help to know when a channel is closed and when is offline.
This is the how the request I’m making looks, to a channel named touchdown_bundy, a channel I know is always offline, but is not closed.
$.ajax({
type: ‘GET’,
url: “https://api.twitch.tv/kraken/streams?client_id=**mykey**&channel=touchdown_bundy”,
dataType: “jsonp”,
jsonpCallback: “twitchcallback”
});
The info I’m getting looks like this:
{“streams”:,“_total”:0,“_links”:{“self”:“https://api.twitch.tv/kraken/streams?channel=touchdown_bundy\u0026limit=25\u0026offset=0",“next”:“https://api.twitch.tv/kraken/streams?channel=touchdown_bundy\u0026limit=25\u0026offset=25”,“featured”:“https://api.twitch.tv/kraken/streams/featured”,“summary”:“https://api.twitch.tv/kraken/streams/summary”,“followed”:"https://api.twitch.tv/kraken/streams/followed”}}
Now, when I request the info concerning a channel that does not exist, for example touchdown_bundy123, I get the exact same information, so I can make no distinction between offline and closed:
{“streams”:,“_total”:0,“_links”:{“self”:“https://api.twitch.tv/kraken/streams?channel=touchdown_bundy123\u0026limit=25\u0026offset=0",“next”:“https://api.twitch.tv/kraken/streams?channel=touchdown_bundy123\u0026limit=25\u0026offset=25”,“featured”:“https://api.twitch.tv/kraken/streams/featured”,“summary”:“https://api.twitch.tv/kraken/streams/summary”,“followed”:"https://api.twitch.tv/kraken/streams/followed”}}
You can take a look at my almost finished project right here: http://codepen.io/ralgtrx/full/RGGAVV