| @@ 6-18 (lines=13) @@ | ||
| 3 | ||
| 4 | class SingRingApiService |
|
| 5 | { |
|
| 6 | public function getAllSongs($apiKey, $apiId, $start, $limit) |
|
| 7 | { |
|
| 8 | $call = curl_init(); |
|
| 9 | curl_setopt($call, CURLOPT_RETURNTRANSFER, 1); |
|
| 10 | curl_setopt( |
|
| 11 | $call, |
|
| 12 | CURLOPT_URL, |
|
| 13 | "http://api.singring.it/getAllSongs.php?API_id={$apiId}&API_key={$apiKey}&start={$start}&limit={$limit}" |
|
| 14 | ); |
|
| 15 | $body = json_decode(curl_exec($call)); |
|
| 16 | curl_close($call); |
|
| 17 | return $body; |
|
| 18 | } |
|
| 19 | ||
| 20 | public function getLyricById($apiKey, $apiId, $id) |
|
| 21 | { |
|
| @@ 20-32 (lines=13) @@ | ||
| 17 | return $body; |
|
| 18 | } |
|
| 19 | ||
| 20 | public function getLyricById($apiKey, $apiId, $id) |
|
| 21 | { |
|
| 22 | $call = curl_init(); |
|
| 23 | curl_setopt($call, CURLOPT_RETURNTRANSFER, 1); |
|
| 24 | curl_setopt( |
|
| 25 | $call, |
|
| 26 | CURLOPT_URL, |
|
| 27 | "http://api.singring.it/getLyricById.php?API_id={$apiId}&API_key={$apiKey}&id={$id}" |
|
| 28 | ); |
|
| 29 | $body = json_decode(curl_exec($call)); |
|
| 30 | curl_close($call); |
|
| 31 | return $body[0]; |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||