function sct_get_djname()
{
// IP oder Hostname des SC-Trans Servers
$sc_host = 'stream.host.de';
// API Port des SC-Trans
$sc_port = '7999';
// API User (Default: admin)
$sc_user = 'admin';
// API Adminpass (Default: goaway)
$sc_pass = 'goaway';
mt_srand((double)microtime()*1000000);
$seq = mt_rand(1,100);
$post = 'op=getstatus&seq=' . $seq;
libxml_use_internal_error(true);
$ch = curl_init($sc_host . '/api');
curl_setopt($ch, CURLOPT_PORT, $sc_port);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, $sc_user . ':' . $sc_pass);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$curl = curl_exec($ch);
$xml = new SimpleXMLElement($curl);
curl_close($ch);
if (!$xml)
{
libxml_clear_errors();
return 'Nicht verfuegbar';
}
if ($xml->data->status->activesource['source'] == 'dj')
{
return (string)$xml->data->status->activesource->name;
}
else
{
return 'Jukebox';
}
}