posting RDS data directly to shoutcast server.


New Member
There is a way to post directly to the shoutcast server the track that is playing, as well as getting data via requests.
I remember a long time ago the url code went something like:
Do we have a current list somewhere of the input url array, query modes, and the output arrays?

also, is there a link in the dnas to get the coded password, or the hash to generate the encoded password for url requests


New Member
I have to note that I had to format it Artist - track with a dash in the middle and a space before and after the dash to parse out the "unknown" off the title.
Last edited:


New Member
here is my code I came up with. I use a computer at the station to query the website for the xml file that the DJ program I have (Jazler) dumps on my website, then I strip out the data and send it to shoutcast dnas. I have like a 10-12 second delay of updating, but acceptable. I do send a little packet out (current time) that doesn't get used for anything other than forcing the browser not to cache the xhr send/response. It loads the track's database ID in a hidden element, then it compares it every 10 seconds then if it sees a different id number, it executes the update code.

on a computer, I installed ubuntu and installed apache and php.

here is what I put in the index.html:

 <p id="innn">

 <div id="trackNowId" style="display:none;"></div>
         <!--- then at the bottom of the page before the </body> tag:
         Jquery is required, I downloaded the jquery.js file from my bootstrap4 web page--->
         <script src="jquery.min.js"></script>
var auto_refresh = setInterval(function() {loadCurrentTrackId(); }, 10000);

function loadCurrentTrackId() {
  var xhr = new XMLHttpRequest();
  xhr.onreadystatechange = function() {

    if (this.readyState == 4 && this.status == 200) {
var oldtrk="";
var tsttrk="";
var oldtrk = document.getElementById('trackNowId').innerHTML;
var tsttrk= this.responseText;   
 if (oldtrk != tsttrk){
 document.getElementById('trackNowId').innerHTML = tsttrk;
  };"GET", "trackid.php"+ ((/\?/).test("trackid.php") ? "&" : "?") + (new Date()).getTime());
  xhr.setRequestHeader( 'CacheControl', false );

function loadXMLDoc() {
  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {

    if (this.readyState == 4 && this.status == 200) {
     document.getElementById('innn').innerHTML = this.responseText;
  };"GET", "update.php"+ ((/\?/).test("update.php") ? "&" : "?") + (new Date()).getTime());
  xhttp.setRequestHeader( 'CacheControl', false );

here is the "trackid.php":

$xml = simplexml_load_file("".time());
echo $xml->Event->Song->Jazler['ID'];
and here is my update.php that updates the code:

// Load xml file to parse in the beginning and set empty variables
$xml= simplexml_load_file("".time());

// parse and load jazler db info of song...
$siid = $xml->Event->Song->Jazler['ID'];
$sTittle= $xml->Event->Song['title'];
$sArtist= $xml->Event->Song->Artist['name'];

/// format the text string to send:

$uText=$sArtist." - ".$sTittle;

$ip = "DNAS_IP_NUMBER"; // Server Address
$port = "DNAS_PORT"; // Server Port that is used to access the home page of the shoutcast dnas server
$pass = "shoutcast_admin_password"; // Admin Password

$song = urlencode($uText);
$song = str_replace("+", "%20", $song);
        $fp = @fsockopen($ip,$port,$errno,$errstr,4);
        if (!$fp) {
            print "Error: cant get server, please check that server is online";
        } else {
            fputs($fp, "GET /admin.cgi?pass=" . $pass . "&mode=updinfo&song=" . $song . " HTTP/1.0\r\n");
            fputs($fp, "User-Agent: Mozilla\r\n\r\n");
echo "update sent:  ".$uText;