Php 如何在嵌入式SoundCloud播放器上添加搜索?
我正在为我的网站编写SoundCloud播放器。我想知道我是否可以使用SoundCloudAPI搜索歌曲Php 如何在嵌入式SoundCloud播放器上添加搜索?,php,javascript,soundcloud,Php,Javascript,Soundcloud,我正在为我的网站编写SoundCloud播放器。我想知道我是否可以使用SoundCloudAPI搜索歌曲 请共享任何其他参考或示例。Soundcloud API端点为您提供: 如果您在这里创建了一个小提琴来演示如何使用SC JS SDK SC.initialize({ 客户id:“201B55A1A1XXXXXXXXXXXXXXXX”, //重定向\u uri:“http://example.com/callback.html", }); SC.get(“/tracks”,{limit:10
请共享任何其他参考或示例。Soundcloud API端点为您提供: 如果您在这里创建了一个小提琴来演示如何使用SC JS SDK
SC.initialize({
客户id:“201B55A1A1XXXXXXXXXXXXXXXX”,
//重定向\u uri:“http://example.com/callback.html",
});
SC.get(“/tracks”,{limit:10,类型:“jazz”},函数(tracks){
var length=tracks.length;
对于(变量i=0;i ');
}
});
您的示例看起来像是使用php后端实现的
因此,这是适合您的SDK:
这是一个使用此SDK的php示例:
<?php
include 'Services/Soundcloud.php';
$soundcloud = new Services_Soundcloud('yourClientId', 'yourClientSecret', 'yourRedirectUri');
try {
$tracks = json_decode($soundcloud->get('tracks', array('genres' => 'jazz', 'limit' => '10')));
} catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
exit($e->getMessage());
}
print_r($tracks);
?>
<?php
include 'Services/Soundcloud.php';
$soundcloud = new Services_Soundcloud('yourClientId', 'yourClientSecret', 'yourRedirectUri');
try {
$tracks = json_decode($soundcloud->get('tracks', array('genres' => 'jazz', 'limit' => '10')));
} catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
exit($e->getMessage());
}
print_r($tracks);
?>