dev-master
9999999-dev https://github.com/cperezabo/shoutcast-server-informationA php library to get information from Shoutcast v2
MIT
The Requires
- php >=5.3.0
server information shoutcast ioduck cperezabo winamp
A php library to get information from Shoutcast v2
It's just another library to get information from a Shoutcast Server
It supports Shoutcast Server 2+., (*1)
<?php include 'shoutcast.php'; $s = new Shoutcast('10.211.55.3', '8000'); if (!$s->server_online()) { echo 'Server offline'; } else { if (0 == $s->get('STATION_STATUS')) { echo 'Transmition off'; } else { $format = '<strong>%s:</strong> %s <br />'; //Print Current Listeners printf($format, 'Current Listeners', $s->get('CURRENT_LISTENERS')); //Print Current Song printf($format, 'Current Song', $s->get('CURRENT_SONG')); //Print Song History if ($s->admin_mode()) { $str_history = ''; foreach ($s->get('SONG_HISTORY') as $song) { $str_history .= '<br />'.$song['TITLE']; } printf($format, 'Song History', $str_history); } } }
public Shoutcast::server_online (void)
Returns TRUE or FALSE depending on the server status.
If you want get the transmission status, use the STATION_STATUS variable., (*2)
public Shoutcast::admin_mode (void)
Returns TRUE or FALSE depending if it is in admin mode or not. You have to provide an admin password to the class constructor., (*3)
public Shoutcast::get (string $var)
Returns the value for the given var, if it is not available, it just returns an empty string, (*4)
CURRENT_LISTENERS : Amount of current listeners.
CURRENT_SONG : Current song
NEXT_SONG : Guess what?, (*5)
LISTENERS_PEAK : Max simultaneous listeners at a certain moment
LISTENERS_LIMIT : Max simultaneous listeners allowed
UNIQUE_LISTENERS : Amount of listeners by IP
STATION_STATUS : TRUE or FALSE depending on whether someone is transmitting or not, (*6)
STATION_GENRE
STATION_URL
STATION_TITLE, (*7)
DJ, (*8)
CONTENT_TYPE : Content MIME
BITRATE : Transmission bitrate
SERVER_VERSION, (*9)
Only with admin password:, (*10)
SONG_HISTORY : Array ( TIMESTAMP, TITLE )
LISTENERS : Array ( HOST, PLAYER, UNDER_RUNS, CONNECT_TIME, POINTER, UID}), (*11)
As you already noticed, it doesn't cover all the XML API, only the most useful information, just to keep it simple. If you need more, let me know! or fork it instead., (*12)
A php library to get information from Shoutcast v2
MIT
server information shoutcast ioduck cperezabo winamp