-1

I am trying to use the soundcloud resolve to get track id from a soundcloud url.

My code is:

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

When I run this, I get the error:

Fatal error: require_once(): Failed opening required 'Services/Soundcloud.php'

Where do I get 'Services/Soundcloud.php' from?

Do I need to link to this on the soundcloud website, or do I need to download include files?

dario
  • 5,149
  • 12
  • 28
  • 32
R2D2
  • 2,620
  • 4
  • 24
  • 46
  • https://github.com/mptre/php-soundcloudb / http://stackoverflow.com/tags/soundcloud/info – mario Jun 22 '15 at 18:10
  • Where did you get this code from? How do you know that you need "Soundcloud.php"? – Dan Ross Jun 22 '15 at 18:10
  • The code is listed in many places online and on stackoverflow as the accepted way to get track id from url. – R2D2 Jun 22 '15 at 18:13
  • EG: http://stackoverflow.com/questions/20870270/how-to-get-soundcloud-embed-code-by-soundcloud-com-url – R2D2 Jun 22 '15 at 18:20

1 Answers1

0

I have found another way to get the file details from soundcloud without requiring this "Services/Soundcloud.php" include.

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

I can use a url such as that above, which returns the file data in json format, and then I can just parse the response.

This seems to work fine.

R2D2
  • 2,620
  • 4
  • 24
  • 46