Get multiple streams JSON data from twitch API

纵饮孤独 提交于 2020-01-14 04:10:07

问题


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)

Call #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);
});    

Call #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);
});

回答1:


The right code:

        $.getJSON("https://api.twitch.tv/kraken/streams.json?channel=viagamehs,starladder1&callback=?", function(response){
            response = JSON.stringify(response);
            console.log(response);
        });	 


来源:https://stackoverflow.com/questions/30548486/get-multiple-streams-json-data-from-twitch-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!