maintainer = "kranack"; $this->name = "Soundcloud Bridge"; $this->uri = "http://www.soundcloud.com/"; $this->description = "Returns 10 newest music from user profile"; $this->parameters[] = '[ { "name" : "username", "identifier" : "u" } ]'; } const CLIENT_ID = '0aca19eae3843844e4053c6d8fdb7875'; public function collectData(array $param){ if (isset($param['u']) && !empty($param['u'])) { $this->request = $param['u']; $res = json_decode(file_get_contents('https://api.soundcloud.com/resolve?url=http://www.soundcloud.com/'. urlencode($this->request) .'&client_id=' . self::CLIENT_ID)) or $this->returnServerError('No results for this query'); $tracks = json_decode(file_get_contents('https://api.soundcloud.com/users/'. urlencode($res->id) .'/tracks?client_id=' . self::CLIENT_ID)) or $this->returnServerError('No results for this user'); } else { $this->returnClientError('You must specify username'); } for ($i=0; $i < 10; $i++) { $item = new \Item(); $item->author = $tracks[$i]->user->username .' - '. $tracks[$i]->title; $item->title = $tracks[$i]->user->username .' - '. $tracks[$i]->title; $item->content = '