Hey. Can anybody tell me where I can get a good radio stat php script from? I'm having trouble finding one which includes the stream title, listeners and song currently playing.
Any help would be great.
Thanks.

Hey. Can anybody tell me where I can get a good radio stat php script from? I'm having trouble finding one which includes the stream title, listeners and song currently playing.
Any help would be great.
Thanks.
http://habboarchive.net webscripts > radio statistics and basic radio stats![]()
Mm. I had a little mess around with some stats for my fansite yesterday. It was in my user.core but I removed some stuff and special features and here are the stats
PHP Code:<?php
function stream($info)
{
// Put radio info into readable variables.
$shoutcastIP = 'ip';
$shoutcastPort = 'port';
$shoutcastAdmin = 'adminpassword';
$streamConnection = fsockopen($shoutcastIP, $shoutcastPort, &$errno, &$errString,
10);
if (!$streamConnection)
{
echo 'Eror';
}
else
{
// Set user agent for shoutcast and admin url.
fputs($streamConnection, "GET /admin.cgi?pass=" . $shoutcastAdmin .
"&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n");
// Run the while.
while (!feof($streamConnection))
{
$shoutcastPage .= fgets($streamConnection, 1000);
}
// Check what user wants.
if ($info == 'CURRENTLISTENERS' or $info == 'PEAKLISTENERS' or $info ==
'MAXLISTENERS' or $info == 'SERVERGENRE' or $info == 'SERVERURL' or $info ==
'SERVERTITLE' or $info == 'STREAMSTATUS' or $info == 'BITRATE')
{
// Seperate listeners from string.
$returnPage = ereg_replace(".*<" . $info . ">", "", $shoutcastPage);
$returnPage = ereg_replace("</" . $info . ">.*", "", $returnPage);
// Obvious.
$return = urldecode($returnPage);
// Return the total listeners.
return security::secureStr($return);
}
else
{
return false;
}
}
}
?>
I just did $user->stream('CURRENTLISTENERS'); when I called it but because you're on functions here I'd guess you would do
To display the current listeners. And so on and so forth.PHP Code:echo stream('CURRENTLISTENERS');
Oh this is kinda useless for you because it doesn't display songs yet. Oh well too late.
O damn. Sorry for double post. If you see stuff like security::secureStr or w/e then sorry. Delete it.
Want to hide these adverts? Register an account for free!