Soundcloud API support pagination?

你说的曾经没有我的故事 提交于 2019-12-23 06:38:28

问题


How would I use the "linked_partitioning=1" to call on the "next_href" in the response? I see the next_href in the response, but I don't know what to do next?

:\ Please help Thank you in advance :)


回答1:


You just have to make a call to this url.

Read more here:

  • https://developers.soundcloud.com/blog/offset-pagination-deprecated
  • https://developers.soundcloud.com/docs/api/guide#errors

EDIT:

According to your comments, i have added some code in JS, which print all tracks from Boilerroom.

Using SoundCloud SDK + jquery, this is an excerpt.

function linked(obj){
if(obj.next_href)
    {
    loadMore(obj.next_href);
    console.log(obj.next_href)
    }

    $.each(obj.collection, function( key, val ) {
    $('#result').append(val.title + '<br/>');
  });    

}

function loadMore(url){
    $.getJSON( url, function( tracks ) {
        linked (tracks);
  });
}

http://jsfiddle.net/iambnz/tehd02y6/



来源:https://stackoverflow.com/questions/29327076/soundcloud-api-support-pagination

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