从twitch API获取多个流JSON数据 [英] Get multiple streams JSON data from twitch API
本文介绍了从twitch API获取多个流JSON数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有两个json调用,而#2正在进行.我对第一个(多个流)一无所知.
There are two json calls and the call #2 is working. I don't have any idea about the first one (multiple streams).
(我知道有些人会说:去那里阅读文档",但这对我没有太大帮助.
(I know some of you would say: "go and read the docs right there", but it didn't help me very much. https://github.com/justintv/Twitch-API/blob/master/v2_resources/streams.md)
致电1:
$.getJSON("h ttps://api.twitch.tv/kraken/streams?channel=viagamehs,starladder1.json?callback=", function(response){
response = JSON.stringify(response);
OBjonline = jQuery.parseJSON(response);
alert(response);
});
呼叫2:
$.getJSON("h ttps://api.twitch.tv/kraken/streams/viagamehs_ru.json?callback=?", function(response){
response = JSON.stringify(response);
OBjonline = jQuery.parseJSON(response);
alert(response);
});
推荐答案
正确的代码:
$.getJSON("https://api.twitch.tv/kraken/streams.json?channel=viagamehs,starladder1&callback=?", function(response){
response = JSON.stringify(response);
console.log(response);
});
这篇关于从twitch API获取多个流JSON数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文