html example for how to show broadcasting online

Talk about whatever.
Post Reply
User avatar
whoooshh
Posts: 2
Joined: Tue Aug 06, 2002 9:22 pm
Location: texas
Contact:

html example for how to show broadcasting online

Post by whoooshh »

hi im using sam and shoutcast to broadcast and would like to see an example html for showing my station status on my web page...thanks for any help
May all your ups and Downs in life be under the Sheets! :-)
User avatar
matt4001
Posts: 3
Joined: Sun Jul 28, 2002 8:37 pm
Location: California
Contact:

I was wanting to...

Post by matt4001 »

I was wanting to know the exact same thing. Can sombody PLEASE tell me? http://matt4001radio.vze.com
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

I am not that familiar with sam, so I sure don't :)
- Jay
User avatar
matt4001
Posts: 3
Joined: Sun Jul 28, 2002 8:37 pm
Location: California
Contact:

Any other ways?

Post by matt4001 »

Are there any other ways of doing it besides with sam?
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

sure there are, but you have to have php to use any of my methods, but I am sure at some point even radiotoolbox can support this feature via FTP.

If you have php just use this script

Code: Select all

<?php

function OfforOn($host, $port, $wait_sec)
{
	$fp = fsockopen($host, $port, &$errstr, &$errno, $wait_sec);

	if ($fp)
	{
		fputs($fp, "GET / HTTP/1.0\r\nUser-Agent:AmIoffOrOn\r\n\r\n");
	
		$ret = fgets($fp, 255);
	
		if (eregi("200", $ret))
		{
			return true;
		}
		else
		{
			return false;
		}

		fclose($fp);
	}
	else
	{
		return false;
	}
}

echo "I am ";
if (OfforOn("audio.str3am.com", 4080, 1))
{
	echo "On";
}
else
{
	echo "Off";
}
?>
you can see it in action here http://www.radiotoolbox.com/shoutcast/amiofforon.php
- Jay
jaleel
Posts: 27
Joined: Tue Jan 28, 2003 11:15 pm
Contact:

In Action :lol:

Post by jaleel »

404 Not Found
Make sure your fingers are on the right keys, because whatever you just typed didn't make sense to me.
:lol:
But seriously, the page /shoutcast/amiofforon.php which you requested appears to not exist.
JE - Urban Hitz Radio
Posts: 4
Joined: Tue Jul 16, 2002 2:02 am
Location: New York City NY
Contact:

Re: In Action :lol:

Post by JE - Urban Hitz Radio »

jaleel wrote:404 Not Found
Make sure your fingers are on the right keys, because whatever you just typed didn't make sense to me.
:lol:
But seriously, the page /shoutcast/amiofforon.php which you requested appears to not exist.
If you need to see it in action, I uploaded one to my server.....

http://www.urbanhitzradio.us/html/off-on.php

THANKs,
JE
DaMan
Posts: 1
Joined: Fri Apr 18, 2003 9:56 am
Location: USA
Contact:

Post by DaMan »

You can find some good code that does exactly that here:
http://forums.winamp.com/showthread.php ... adid=82943

Hope that helps...

DaMan

http://shoutworld.chapware.com
Post Reply