Subject: Shoutcast Block?

Posted on: 05/10/04 09:58am
By: Kutulu

I'm just wondering if anyone has had any success in creating a shoucast block displaying current and recently played songs. Heck... a static page for that matter. Been going batty trying to figure this one out.

Success stories? aka...

Shoutcast Block?

Posted on: 07/10/04 03:57pm
By: Kutulu

Got it running in a static php enabled page with xml running on the back side. Now... I'm going to get this running in a block. Once complete... I'll be more than happy to post it.

Shoutcast Block?

Posted on: 01/11/04 09:57am
By: varian vega

Did you succeed? If yes, it would be nice if you could share the code! Thanx, varian

Shoutcast Block?

Posted on: 01/11/04 12:15pm
By: Anonymous

VV,

As of yet I haven't. I'm hoping to have it finished within the next 2 weeks. My wife gave birth to our new little girl so I've been kinda tied up!

Don't worry.... I WILL be posting the code once it's complete!

Shoutcast Block?

Posted on: 20/11/04 09:35pm
By: Faust-Eternal

Sounds great......congrats by the way.

I am looking forward to the release!

Shoutcast Block?

Posted on: 20/11/04 10:02pm
By: squatty

Probably not what you're looking for but...I created a php block for my Squeezebox here. Some of the code might be reusable for Shoutcast.

BTW, if you don't know what a Squeezebox is...check it out here.

Shoutcast Block?

Posted on: 11/09/05 06:36pm
By: Anonymous

Hello there
I'm new to geeklog, and kinda like the approach, simple to use, and have what i need..
I was wondering if u every found a solution for this answer, i'll be curiouis to know, since i'm also using shout cast, and SAM broadcaster,

would like to interface it with my new to come website

regards

Shoutcast Block?

Posted on: 12/09/05 05:33am
By: Anonymous

here is some code that i modified for use on my brothers website. i am not sure if this will work but give it a try



Function phpblock_radio () {

// Fill in your own server information here:	
	$host = "darkpitradio.elitepalaces.com";
	$port = "8000";
	$listenlink = 'http://darkpitradio.elitepalaces.com:8000/listen.pls';  //make link to stream
	
	$fp = fsockopen("$host", $port, &$errno, &$errstr, 30); //open connection
	if(!$fp) {
		$success=2;  //se-t if no connection
	}
	if($success!=2){ //if connection
		fputs($fp,"GET /7.html HTTP/1.0rnUser-Agent: XML Getter (Mozilla Compatible)rnrn"); //get 7.html
		while(!feof($fp)) {
			$page .= fgets($fp, 1000);
		}
		fclose($fp); //close connection
		$page = ereg_replace(".*<body>", "", $page); //extract data
		$page = ereg_replace("</body>.*", ",", $page); //extract data
		$numbers = explode(",",$page); //extract data
		$currentlisteners=$numbers[0]; //set variable
		$connected=$numbers[1]; //set variable

		if($connected==1) //if DSP is connected
			$wordconnected="yes"; //set variable
		else //if no DSP connection
			$wordconnected="no"; //set variable
		$peaklisteners=$numbers[2]; //set variable
		$maxlisteners=$numbers[3]; //set variable
		$reportedlisteners=$numbers[4]; //set variable
	}


	
	if($success!=2 && $connected==1){

// song information is splitted in artist - title: 
// This requires consistent artist & title format (no ' - ' in title/artist)
// else you can use $numbers[6] as current song info below
		$song=explode(" - ",$numbers[6]);
		
// strings can of course be replaced with your own bla
		$display .= "Now playing on Darkpit Radio<br>";
		$display .= "Artist: ". $song[0] . "<br>";
		$display .= "Song: ". $song[1] . "<br>";
		$display .= "[$currentlisteners/$maxlisteners users]"."<br> <a target='_new' href=' " . $listenlink ."'>[click to listen]</a> ";
	}
	else {
		$display .= "Darkpit Radio is currently";
		$display .= "OFFLINE.";
		$display .= "Please return later.";
		$display .=":::";
	}
	
          return $display;

}



this might work for you

Shoutcast Block?

Posted on: 10/04/06 09:53am
By: Anonymous

@Trinity
I tried your php_block on my site, but not succesful..
Even though I am listening to the Radio, it states that the Radio is Offline..
Any ideas to what that could cause this?

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=41247