SHOUTrds

- A stream RDS solution for SHOUT -and ICEcast

Navigation

Home
Screenshots
Patches
Plugins
SHOUTrds twitter
RDS on your website
Version 1.x

Recent News

Lower price
March, 01 1 2012
SHOUTrds 2.5 released!
August, 14 14 2011
Version 1 available
July, 15 15 2011
SHOUTrds 2.5 Preview
May, 20 20 2011
Website update! 2010-04-09
April, 09 9 2010

Calendar

Back February '21
Mon Tue Wed Thu Fri Sat Sun
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
  • Home
  • News
  • Get a demo
  • Purchase
  • Contact

Scripts

SHOUTrds is a streamrds software that just updates the songtitle of your SHOUTcast server, so putting it on your webiste is quite easy!
Here is how it works:

RDS provided by HotTracksFM!

Loading, please wait. . .

Here is how it works

The first thing you need is a JavaScript file which contains the code to "Update" the stream title every ×× seconds.
The script looks like this:

Filename: rds.js
var xmlHttp

function showrds(str)
{
  xmlHttp=GetXmlHttpObject()
  if (xmlHttp==null)
    {
    alert ("Browser does not support HTTP Request")
    return
    }
  var url="rds.php"
  url=url+"?q="+str
  url=url+"&sid="+Math.random()
  xmlHttp.onreadystatechange=stateChanged
  xmlHttp.open("GET",url,true)
  xmlHttp.send(null)
  setTimeout("showrds()", 5000);
  }
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 {
 document.getElementById("txtHint").innerHTML=xmlHttp.responseText
 }
}function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}

So when we have the rds.js file, we can write a peace of HTML code to execute the function "showrds" in the script file.
Include the following html code in the >head> part of your website (somewhere else is also possible).
<script> src="rds.js"></script>

<script>
showrds();
</script>

As you can see in the rds.js, it calls a file called "rds.php".
This file reads the SHOUTcast 7.html to retrieve song information, current stream status, current listeners, max listeners etc.
The file may look like this:
<?php
error_reporting(0);

if(!$fp = @fsockopen("host", "port", &$errno, &$errstr, 3))
{
// Connection failed
echo "Server is currently down!";
} else {
//Get 7.html
fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");
while(!feof($fp)) {
//The var $page gets the result of the 7.html.
$page = fgets($fp, 1000);
}

//Close the connection because we no longer need it.
fclose($fp);

//Remove stuff we don't need ( html tags)
$page = ereg_replace(".*<body>", "", $page);
$page = ereg_replace("</body>.*", ",", $page);

//Rip data we need.
$shoutcast = explode(",",$page);

//Convert pageinfo to variable
//Je kunt commanten wat je nie nodig hebt... hoeft niet...

$luisteraars = $shoutcast[0]; //Number of listeners
$streaming = $shoutcast[1]; //streamstatus 1 = streaming 0 = not streaming
$piek = $shoutcast[2]; //Peak
$max = $shoutcast[3]; //Max. listeners
$unieke = $shoutcast[4]; //Unique listeners
$bitrate = $shoutcast[5]; //Bitrate
$song = $shoutcast[6]; //Current song

//Is streaming? display something

if(isset($streaming)) {
if($streaming == "1") {
Echo $song; // output "$song" (the songtitle) this output will be shown on the RDS container.
}
}
//There is no stream
if(isset($streaming)) {
if($streaming == "0") {
echo "Server is currently down!";
}
}
}
?>

So now we've got all the scripts ready, but we want to display the RDS somewhere on the page.
Use the following code "somewhere" on your HTML page.
<div id="txtHint"><b>Loading, please wait. . .</b></div>
The text between <div> and </div> will be replaced with the "Echo $song;" from the rds.php file.

© 2007 - 2010 SHOUTrds. SHOUTrds is part of LMeijer.nl

Quicksearch

RSS Feeds

  • XML
  • XML Comments

Recent Entries

Lower price
Thursday, March 1 2012
SHOUTrds 2.5 released!
Sunday, August 14 2011
Version 1 available
Friday, July 15 2011
SHOUTrds 2.5 Preview
Friday, May 20 2011
Website update! 2010-04-09
Friday, April 9 2010
SHOUTrds 2.5 - Under construction!
Friday, April 2 2010
Brand new website
Friday, March 26 2010
The IceCast and TextFile coder have been updated to version 1.1!
Tuesday, August 5 2008
SHOUTrds 2.1 Released!
Friday, July 25 2008
Plugins and Tools page online!
Tuesday, May 27 2008

Static Pages

Frontpage
Home
Screenshots
Patches
Plugins
v1x