$url_radio = 'https://api.jamendo.com/v3.0/radios/stream/?client_id='.CLIENT_ID_J.'&format=jsonpretty&name='.$id;
$result = file_get_contents($url_radio);
$update = json_decode($result, true);
$res = $update['results'];
$sendto =API_URL."sendmessage?chat_id=".$chatID."&text=".urlencode($res[0]['dispname']);
file_get_contents($sendto);
$sendto =API_URL."sendPhoto?chat_id=".$chatID."&photo=".urlencode($res[0]['playingnow']['track_image']);
file_get_contents($sendto);
$name = $res[0]['playingnow']['track_name'].' - '.$res[0]['playingnow']['artist_name'];
$url_track = 'https://api.jamendo.com/v3.0/albums/tracks/?client_id='.CLIENT_ID_J.'&track_id='.$res[0]['playingnow']['track_id'];
$result = file_get_contents($url_track);
$update = json_decode($result, true);
$res = $update['results'][0];
$sendto =API_URL."sendmessage?chat_id=".$chatID."&text=".urlencode($name.chr(10).$res["tracks"][0]['audio']);
file_get_contents($sendto);
它完美无缺,但我会避免过多的调用:" file_get_contents($ sendto);"。
有没有其他方法可以避免这3次来电?