2015-06-22 17 views
-1

我正在尝试使用soundcloud解析来从soundcloud网址获取曲目ID。找不到服务/ Soundcloud.php?

我的代码是:

require_once 'Services/Soundcloud.php'; 
$client = new Services_Soundcloud('CLIENT_ID'); 
$track = json_decode($client->get('resolve', array('url' => $form_link))); 
$soundcloud_id -> id; 

当我运行它,我得到的错误:

致命错误:require_once():失败需要开放 '服务/ Soundcloud.php'

我从哪里得到'Services/Soundcloud.php'?

我需要链接到soundcloud网站上的这个,还是我需要下载包含文件?

+0

https://github.com/mptre/php-soundcloudb/http://stackoverflow.com/tags/soundcloud/info – mario

+0

你从哪里得到这段代码?你怎么知道你需要“Soundcloud.php”? –

+0

该代码在许多地方在网上和在stackoverflow作为可接受的方式来从url获得track id。 – Richard

回答

0

我发现了另一种从soundcloud获取文件细节的方法,不需要包含“Services/Soundcloud.php”。

http://api.soundcloud.com/resolve.json?url=http://soundcloud.com/matas/hobnotropic&client_id=CLIENT_ID 

我可以使用URL诸如上面,它返回JSON格式的文件数据,然后我可以只解析响应。

这似乎工作正常。