<?php $file = file("/var/log/icecast2/playlist.log"); $file_array = $file; $far = array_slice($file, -1); $far = array_reverse($far); foreach ($far as $arr1 => $arr2){ $elem = explode('|', $arr2); $song = $elem[3]; $infos_artist = explode(' - ', $song); $infos_artist[0] = urlencode(trim($infos_artist[0])); $infos_artist[1] = urlencode(trim($infos_artist[1])); $partnerId = "1"; $partnerKey = "1"; $stationId = "1"; $artist_tunein = str_replace(' ','+', $infos_artist[0]); $title_tunein = str_replace(' ','+', $infos_artist[1]); $commercial = false; if (($infos_artist[0] == "HCore+FM") || ($infos_artist[0] == "Promo")) $commercial = true; $url_tunein = "http://air.radiotime.com/Playing.ashx?partnerId=".$partnerId."&partnerKey=".$partnerKey."&id=".$stationId."&title=".$title_tunein."&artist=".$artist_tunein."&commercial=".$commercial; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url_tunein); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch); $server_output = simplexml_load_string($data); curl_close($ch); ?>
header('Content-type: text/html; charset=UTF-8');
$data = utf8_decode(curl_exec($ch));
."&title=".$title_tunein."&artist=".$artist_tunein."&commercial=".$commercial
curl_setopt($ch, CURLOPT_URL, $url_tunein); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "&title=".$title_tunein."&artist=".$artist_tunein."&commercial=".$commercial);