问题
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