diff --git a/bridges/SoundcloudBridge.php b/bridges/SoundcloudBridge.php new file mode 100644 index 0000000..05c47bf --- /dev/null +++ b/bridges/SoundcloudBridge.php @@ -0,0 +1,55 @@ +request = $param['u']; + + $res = json_decode(file_get_contents('http://api.soundcloud.com/resolve.json?url=http://www.soundcloud.com/'. urlencode($this->request) .'&consumer_key=apigee')) or $this->returnError('No results for this query', 404); + $tracks = json_decode(file_get_contents('http://api.soundcloud.com/users/'. urlencode($res->id) .'/tracks.json?consumer_key=apigee')) or $this->returnError('No results for this user', 404); + } + else + { + $this->returnError('You must specify username', 400); + } + + for ($i=0; $i < 10; $i++) { + $item = new \Item(); + $item->name = $tracks[$i]->user->username .' - '. $tracks[$i]->title; + $item->title = $tracks[$i]->user->username .' - '. $tracks[$i]->title; + $item->content = '