我使用以下代码从SoundCloud获取曲目列表。问题是它只返回200首曲目,而不是整个列表。有人能帮帮忙吗。
$soundcloud_url = "http://api.soundcloud.com/users/{$userid}/tracks.json?client_id={$clientid}&limit=10000";
$tracks_json = file_get_contents($soundcloud_url); //get tracks
$tracks = json_decode($tracks_json); //convert tracks 发布于 2015-11-14 22:30:09
这是API返回的集合项的最大值,默认设置为50,但最高可以设置为200。
您可以在曲目集合中翻页,检查以下使用linked_partitioning参数的代码,该参数指示响应包含指向下一个集合的next_href属性:
# start paging through results, 100 at a time
tracks = client.get('/tracks', order='created_at', limit=page_size,
linked_partitioning=1)
for track in tracks:
print track.title有关详细信息,请查看this。
https://stackoverflow.com/questions/33709354
复制相似问题