Old 28th October 2012, 02:50   #1
Yuji-Sakai
Junior Member
 
Join Date: Oct 2012
Posts: 2
[REQ] Shoutcast v2 Status ( PHP Code )

VPS : Centos 06 32bit
NODE : node7

Hey guys.. i've just installed Shoutcast v2 in my VPS... DO anyone have a code that will show the current listeners, DJ, and current song ? i just need ^_^
Yuji-Sakai is offline   Reply With Quote
Old 28th October 2012, 09:08   #2
-Pepijn.
Junior Member
 
Join Date: Oct 2012
Posts: 5
Here you go
PHP Code:
<?php
// CONFIGURATION
$ip '0.0.0.0'// IP
$port '8000'// Port
$sid '1'// StreamID

// PHP, DONT TOUCH WHEN YOU DONT KNOW WHAT YOURE DOING.
$shoutcast simplexml_load_file("http://".$ip.":".$port."/stats?sid=".$sid);
$listeners $shoutcast->CURRENTLISTENERS;
$song $shoutcast->SONGTITLE;
$dj $shoutcast->SERVERTITLE;

// EXAMPLES
echo $listeners// Listeners

echo $song// Song

echo $dj// DJ

// MADE BY PEPIJN :)
?>

Last edited by -Pepijn.; 28th October 2012 at 11:02. Reason: Removed my own IP
-Pepijn. is offline   Reply With Quote
Old 1st November 2012, 08:27   #3
Yuji-Sakai
Junior Member
 
Join Date: Oct 2012
Posts: 2
Quote:
Originally Posted by -Pepijn. View Post
Here you go
PHP Code:
<?php
// CONFIGURATION
$ip '0.0.0.0'// IP
$port '8000'// Port
$sid '1'// StreamID

// PHP, DONT TOUCH WHEN YOU DONT KNOW WHAT YOURE DOING.
$shoutcast simplexml_load_file("http://".$ip.":".$port."/stats?sid=".$sid);
$listeners $shoutcast->CURRENTLISTENERS;
$song $shoutcast->SONGTITLE;
$dj $shoutcast->SERVERTITLE;

// EXAMPLES
echo $listeners// Listeners

echo $song// Song

echo $dj// DJ

// MADE BY PEPIJN :)
?>

The page is blank sir...
Yuji-Sakai is offline   Reply With Quote
Old 1st November 2012, 09:32   #4
-Pepijn.
Junior Member
 
Join Date: Oct 2012
Posts: 5
Try this:
PHP Code:
<?php 
// Error reporting on.
error_reporting(-1);

// CONFIGURATION 
$ip '0.0.0.0'// IP 
$port '8000'// Port 
$sid '1'// StreamID 

// PHP, DONT TOUCH WHEN YOU DONT KNOW WHAT YOURE DOING. 
$shoutcast simplexml_load_file("http://".$ip.":".$port."/stats?sid=".$sid); 
$listeners $shoutcast->CURRENTLISTENERS
$song $shoutcast->SONGTITLE
$dj $shoutcast->SERVERTITLE

// EXAMPLES 
echo $listeners// Listeners 

echo $song// Song 

echo $dj// DJ 

// MADE BY PEPIJN :) 
?>
Which error do you get with that script?
-Pepijn. is offline   Reply With Quote
Old 22nd February 2014, 20:03   #5
garysherwood
Junior Member
 
Join Date: Mar 2012
Posts: 3
it works on mine but how do i change the dj name
garysherwood is offline   Reply With Quote
Old 2nd March 2014, 10:12   #6
itprotj
Junior Member
 
Join Date: Jan 2009
Posts: 29
To change the DJ name change the following text. (I've circled it in the picture)

This is presuming your using Winamp to connect to your shoutcast server.
itprotj is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump