Old 15th July 2003, 16:55   #1
ChristianRox
Junior Member
 
Join Date: Mar 2003
Location: Baytown,Tx
Posts: 49
php script for showing current song?

I'm looking for a php script that will scroll the current song/artist on my main site. I've seen it here before, but I've lost the link!
ChristianRox is offline   Reply With Quote
Old 15th July 2003, 17:39   #2
FesterHead
Alumni
 
FesterHead's Avatar
 
Join Date: Sep 2001
Location: Maui, Hawaii
Posts: 14,103
Check out the Sticky post titled...
SHOUTcast: Important Info & Answers to FAQs. READ ME!

Scroll down a bit and look for the section titled...
General SHOUTcast Information -> SHOUTcast ToolBox (All sorts of nifty add-ons for SHOUTcast)

1. The PHP based XML parser is a complete solution and comes ready for you to customize.

2. The Javascript parser (actually ASP) is another complete solution and comes ready for you to customize.
Note: Apparently this link isn't working anymore.
Try this thread for other ASP options.

Also, for an html implementation, check out:
KXRM's RadioToolbox
Oddsock's Do Something DSP plugin

FesterHead is offline   Reply With Quote
Old 15th July 2003, 19:18   #3
ChristianRox
Junior Member
 
Join Date: Mar 2003
Location: Baytown,Tx
Posts: 49
Hmmm. Tried that script, but even though I'm running my own server w php 4.3.2 it won't do anything.

It just has a blank space on the page where I put the code...
ChristianRox is offline   Reply With Quote
Old 15th July 2003, 19:20   #4
WEBcast
Junior Member
 
Join Date: Jul 2003
Posts: 19
<?php
///////////////////////////////////////////
// Author: Radu Bighiu - radu@webcast.ro //
///////////////////////////////////////////

//edit below
$host = "webcast.ro";
$port = "8000";
//stop editing from here

$fp=fsockopen($host,$port,&$errno,&$errstr,10);
if (!$fp) {
echo "Can't connect";
}
fputs($fp,"GET /7 HTTP/1.1\nUser-Agent:WEBcast Mozilla - www.webcast.ro\n\n");
for($i=0; $i<30; $i++) {
if(feof($fp)) break;
$fp_data=fread($fp,31337);
usleep(500000);
}
$fp_data=ereg_replace("^.*<body>","",$fp_data);
$fp_data=ereg_replace("</body>.*","",$fp_data);
list($current,$status,$peak,$max,$reported,$bit,$song) = explode(",", $fp_data);
if ($status == "0") {
echo "<center>Off Air</center>";
} else {
echo "<TABLE>";

//edit below - comment with "//" unnecessary lines
echo "<TR><TD>Current Listeners: </TD><TD>".$current."</TD></TR>";
//echo "<TR><TD>Server Status: </TD><TD>".$status."</TD></TR>";
echo "<TR><TD>Listener Peak: </TD><TD>".$peak."</TD></TR>";
echo "<TR><TD>Supported Listeners: </TD><TD>".$max."</TD></TR>";
echo "<TR><TD>Unique Listeners: </TD><TD>".$reported."</TD></TR>";
echo "<TR><TD>Stream Bitrate: </TD><TD>".$bit." kbps</TD></TR>";
echo "<TR><TD>Current Song: </TD><TD>".$song."</TD></TR>";
//stop editing from here

echo "</TABLE>";
}
?>
WEBcast is offline   Reply With Quote
Old 15th July 2003, 19:27   #5
WEBcast
Junior Member
 
Join Date: Jul 2003
Posts: 19
PHP Code:
<?php
  
///////////////////////////////////////////
 // Author: Radu Bighiu - [email]radu@webcast.ro[/email] //
///////////////////////////////////////////

//edit below
$host "webcast.ro";
$port "8000";
//stop editing from here

$fp=fsockopen($host,$port,&$errno,&$errstr,10);
 if (!
$fp) {
echo 
"Can't connect";
}
fputs($fp,"GET /7 HTTP/1.1\nUser-Agent:WEBcast Mozilla - [url]www.webcast.ro\n\n[/url]");
for(
$i=0$i<30$i++) {
if(
feof($fp)) break;
$fp_data=fread($fp,31337);
usleep(500000);
 }
$fp_data=ereg_replace("^.*<body>","",$fp_data);
$fp_data=ereg_replace("</body>.*","",$fp_data);
list(
$current,$status,$peak,$max,$unique,$bitrate,$song) = explode(","$fp_data);
if (
$status == "0") {
echo 
"<center>Off Air</center>";
} else {
echo 
"<TABLE>";

//edit below - comment with "//" unnecessary lines
echo "<TR><TD>Current Listeners: </TD><TD>".$current."</TD></TR>";
//echo "<TR><TD>Server Status: </TD><TD>".$status."</TD></TR>";
echo "<TR><TD>Listener Peak: </TD><TD>".$peak."</TD></TR>";
echo 
"<TR><TD>Supported Listeners: </TD><TD>".$max."</TD></TR>";
echo 
"<TR><TD>Unique Listeners: </TD><TD>".$unique."</TD></TR>";
echo 
"<TR><TD>Stream Bitrate: </TD><TD>".$bitrate." kbps</TD></TR>";
echo 
"<TR><TD>Current Song: </TD><TD>".$song."</TD></TR>";
//stop editing from here

echo "</TABLE>";
}
?>
See result here: http://radio.webcast.ro/tools/7.php
WEBcast is offline   Reply With Quote
Old 15th July 2003, 20:06   #6
ChristianRox
Junior Member
 
Join Date: Mar 2003
Location: Baytown,Tx
Posts: 49
Thanks! Looks like that did it. Is there a line of code I can put in to make it scroll? I tried the old HTML <marquee> code, but it didn't want to scroll

I'm fairly new to php, but learning fast!
ChristianRox is offline   Reply With Quote
Old 15th July 2003, 20:08   #7
MrOuija
Junior Member
 
Join Date: Jul 2003
Posts: 20
i'm also running php v.4.3.2 and i've modified my script (the host and port) and this is what i get http://psykad.sytes.net:8000/dnas.php

what am i doing wrong?
MrOuija is offline   Reply With Quote
Old 15th July 2003, 20:25   #8
ChristianRox
Junior Member
 
Join Date: Mar 2003
Location: Baytown,Tx
Posts: 49
Quote:
Originally posted by MrOuija
i'm also running php v.4.3.2 and i've modified my script (the host and port) and this is what i get http://psykad.sytes.net:8000/dnas.php

what am i doing wrong?
The script that he posted above seemed to work great. I just modified it (commented some lines) so that only the Current Song is shown. NOW...I found that if I put the "http://" in front of my server, that I had trouble. You may try removing that and see if it works.
ChristianRox is offline   Reply With Quote
Old 15th July 2003, 20:28   #9
WEBcast
Junior Member
 
Join Date: Jul 2003
Posts: 19
other php script is working good with Sambar Server?

try set allow_call_time_pass_reference to true in your PHP.INI file
WEBcast is offline   Reply With Quote
Old 15th July 2003, 20:43   #10
WEBcast
Junior Member
 
Join Date: Jul 2003
Posts: 19
Quote:
Originally posted by ChristianRox
Thanks! Looks like that did it. Is there a line of code I can put in to make it scroll? I tried the old HTML <marquee> code, but it didn't want to scroll

I'm fairly new to php, but learning fast!
Replace all this
PHP Code:
echo "<TABLE>";

//edit below - comment with "//" unnecessary lines
echo "<TR><TD>Current Listeners: </TD><TD>".$current."</TD></TR>";
//echo "<TR><TD>Server Status: </TD><TD>".$status."</TD></TR>";
echo "<TR><TD>Listener Peak: </TD><TD>".$peak."</TD></TR>";
echo 
"<TR><TD>Supported Listeners: </TD><TD>".$max."</TD></TR>";
echo 
"<TR><TD>Unique Listeners: </TD><TD>".$unique."</TD></TR>";
echo 
"<TR><TD>Stream Bitrate: </TD><TD>".$bitrate." kbps</TD></TR>";
echo 
"<TR><TD>Current Song: </TD><TD>".$song."</TD></TR>";
//stop editing from here

echo "</TABLE>"
With:
PHP Code:
echo "<marquee>".$song."</marquee>"
WEBcast is offline   Reply With Quote
Old 15th July 2003, 21:00   #11
MrOuija
Junior Member
 
Join Date: Jul 2003
Posts: 20
lol here's what i have right now:

PHP Code:
<?php 
/////////////////////////////////////////// 
// Author: Radu Bighiu - [email]radu@webcast.ro[/email] // 
/////////////////////////////////////////// 

//edit below 
$host "psykad.sytes.net"
$port "8010"
//stop editing from here 

$fp=fsockopen($host,$port,&$errno,&$errstr,10); 
if (!
$fp) { 
echo 
"Can't connect"

fputs($fp,"GET /7 HTTP/1.1\nUser-Agent:WEBcast Mozilla - [url]www.webcast.ro\n\n[/url]"); 
for(
$i=0$i<30$i++) { 
if(
feof($fp)) break; 
$fp_data=fread($fp,31337); 
usleep(500000); 

$fp_data=ereg_replace("^.*<body>","",$fp_data); 
$fp_data=ereg_replace("</body>.*","",$fp_data); 
list(
$current$status$peak$max$reported$bit$song) = explode(","$fp_data); 
if (
$status == "0") { 
echo 
"<center>Off Air</center>"
} else { 
echo 
"<TABLE>"

//edit below - comment with "//" unnecessary lines 
echo "<TR><TD>Current Listeners: </TD><TD>".$current."</TD></TR>"
echo 
"<TR><TD>Server Status: </TD><TD>".$status."</TD></TR>"
echo 
"<TR><TD>Listener Peak: </TD><TD>".$peak."</TD></TR>"
echo 
"<TR><TD>Supported Listeners: </TD><TD>".$max."</TD></TR>"
echo 
"<TR><TD>Unique Listeners: </TD><TD>".$reported."</TD></TR>"
echo 
"<TR><TD>Stream Bitrate: </TD><TD>".$bit." kbps</TD></TR>"
echo 
"<TR><TD>Current Song: </TD><TD>".$song."</TD></TR>"
//stop editing from here 

echo "</TABLE>"

?>
the port is 8010 for a reason. the sambar server is on 8000. if you clicked the link to my site, you would have seen the error:


Notice: Undefined offset: 6 in C:\SAMBAR52\docs\dnas.php on line 23

Notice: Undefined offset: 5 in C:\SAMBAR52\docs\dnas.php on line 23

Notice: Undefined offset: 4 in C:\SAMBAR52\docs\dnas.php on line 23

Notice: Undefined offset: 3 in C:\SAMBAR52\docs\dnas.php on line 23

Notice: Undefined offset: 2 in C:\SAMBAR52\docs\dnas.php on line 23

Notice: Undefined offset: 1 in C:\SAMBAR52\docs\dnas.php on line 23


so it's all coming from one line. i don't much php, just enough to communicate with mysql. i don't know what the offset is or means. anyone see what the problem is?
MrOuija is offline   Reply With Quote
Old 15th July 2003, 21:31   #12
ChristianRox
Junior Member
 
Join Date: Mar 2003
Location: Baytown,Tx
Posts: 49
Thanks Webcast! That did the trick!
ChristianRox is offline   Reply With Quote
Old 15th July 2003, 21:56   #13
WEBcast
Junior Member
 
Join Date: Jul 2003
Posts: 19
Quote:
Originally posted by ChristianRox
fputs($fp,"GET /7 HTTP/1.1\nUser-Agent:WEBcast Mozilla - <a href="http://www.webcast.ro\n\n" target="_blank">www.webcast.ro\n\n</a>");
Thanx 4 ur Link but let my code alone... edit, please edit only
PHP Code:
//edit below
$host "webcast.ro";
$port "8000";
//stop editing from here 
and nothing more!

copy my PHP code again and replace only $host & $port
WEBcast is offline   Reply With Quote
Old 15th July 2003, 22:15   #14
Jay
Moderator Alumni
 
Jay's Avatar
 
Join Date: May 2000
Location: Next Door
Posts: 8,941
Just a note on the code above is that each time a listener or webpage viewer executes it they make a request from your shoutcast server, if you have heavy traffic to your site I would not use this code without at least modifing it to properly cache results as to not hammer your server into the ground.

The shoutcast server can only handle one connection to the webadmin at any given time, otherwise it gives you a flood warning.
Jay is offline   Reply With Quote
Old 15th July 2003, 22:51   #15
WEBcast
Junior Member
 
Join Date: Jul 2003
Posts: 19
My code uses "7.html" not XML from "admin.cgi", are you sure about this flood warning?
WEBcast is offline   Reply With Quote
Old 15th July 2003, 22:54   #16
Jay
Moderator Alumni
 
Jay's Avatar
 
Join Date: May 2000
Location: Next Door
Posts: 8,941
it still makes a connection. regardless of what it requests from the server. By the way, why do you have HTML in your User-Agent field, this makes no sense. Plus it goes against the standard.
Jay is offline   Reply With Quote
Old 16th July 2003, 00:14   #17
ChristianRox
Junior Member
 
Join Date: Mar 2003
Location: Baytown,Tx
Posts: 49
Quote:
Originally posted by WEBcast
Thanx 4 ur Link but let my code alone... edit, please edit only
PHP Code:
//edit below
$host "webcast.ro";
$port "8000";
//stop editing from here 
and nothing more!

copy my PHP code again and replace only $host & $port
Now I'm lost...you posted a snippet of code above telling me to replace one part with another in order to make it scroll. I thought I did it correctly and its working like I asked, now you're telling me not to edit below that line? Did I miss something??
ChristianRox is offline   Reply With Quote
Old 16th July 2003, 00:50   #18
Psythik
Got his CT back
and didn't pay $10
(Forum King)
 
Psythik's Avatar
 
Join Date: Aug 2002
Location: Phoenix, AZ
Posts: 3,583
Nice script! Too bad it doesn't work in sigs... Hey festerhead, which script do you use?

This is a sig of some nature.
Psythik is offline   Reply With Quote
Old 16th July 2003, 00:53   #19
MrOuija
Junior Member
 
Join Date: Jul 2003
Posts: 20
WEBcast, you say to only edit the host and port...but there's an error in the code where your site is listed.

PHP Code:
fputs($fp,"GET /7 HTTP/1.1\nUser-Agent:WEBcast Mozilla - <a href="http://www.webcast.ro\n\n" target="_blank">[url]www.webcast.ro\n\n[/url]</a>"); 
for that line to work you have to either take the quotes around http://www.webcast.ro and _blank or put a \ in front of them. that takes care of that error for me. but i'm still stuck on the offset errors. they point to this line (line 23):

PHP Code:
$fp_data=ereg_replace("</body>.*","",$fp_data); 
what offset is it talking about?
are you the writer of this code?
MrOuija is offline   Reply With Quote
Old 16th July 2003, 01:35   #20
FesterHead
Alumni
 
FesterHead's Avatar
 
Join Date: Sep 2001
Location: Maui, Hawaii
Posts: 14,103
I use something I crafted based on code at KXRM's site RadioToolbox.

See this thread.

FesterHead is offline   Reply With Quote
Old 16th July 2003, 02:16   #21
MrOuija
Junior Member
 
Join Date: Jul 2003
Posts: 20
final words

well it seems as if this code isn't going to work for my application. i guess i'll write my own script to do it. when i finish i will post it. thanks for your guys help
MrOuija is offline   Reply With Quote
Old 16th July 2003, 04:37   #22
ChristianRox
Junior Member
 
Join Date: Mar 2003
Location: Baytown,Tx
Posts: 49
Quote:
Originally posted by MrOuija
WEBcast, you say to only edit the host and port...but there's an error in the code where your site is listed.

what offset is it talking about?
are you the writer of this code?
I had no problem using his code. It worked great and did exactly what I needed. My problem is understanding why I asked for a line of code that scrolls and he gave me a fix only to come back and say not to edit below a certain line...
The only way to apply that fix IS to edit below the "Do not edit below this" line...

I'm confused...
ChristianRox is offline   Reply With Quote
Old 16th July 2003, 04:42   #23
MrOuija
Junior Member
 
Join Date: Jul 2003
Posts: 20
i finished my code. it works for me now.

PHP Code:
<?
Header
("Content-Type: image/jpeg");

$host "psykad.sytes.net";
$port "8010";

$fp=fsockopen($host$port, &$errno, &$errstr10);
if (!
$fp) {
 exit();
}

fputs($fp"GET /7 HTTP/1.1\nUser-Agent:Mozilla\n\n");

for (
$i=0$i<30$i++) {
 if (
feof($fp)) break;
 
$fp_data=fread($fp31337);
 echo 
fread($fp$fp);
 list(
$current,$status,$peak,$max,$unique,$bitrate,$song) = explode(","$fp_data);
 
usleep(500000);
}

$song ereg_replace("</body></html>$"""$song);
$im ImageCreate(40050);
$white ImageColorAllocate($im255255255);
$black ImageColorAllocate($im000);
ImageFill($im100100$black);
ImageString($im311"The Boneyard Radio"$white);
ImageString($im3115"Currently Playing:"$white);
ImageString($im2135$song$white);
ImageJPEG($im);
ImageDestroy($im);
?>
it's probaly not the most efficient code but it gets the job done.
MrOuija is offline   Reply With Quote
Old 16th July 2003, 05:00   #24
Jay
Moderator Alumni
 
Jay's Avatar
 
Join Date: May 2000
Location: Next Door
Posts: 8,941
I wouldn't use images like that, your server each time a user makes a request on the script your server will have to render an image, so it won't take long to really start causing havoc. I would cache that image and make a cron do the work of executing the code to save on CPU and Overall Server Load.
Jay is offline   Reply With Quote
Old 16th July 2003, 05:02   #25
MrOuija
Junior Member
 
Join Date: Jul 2003
Posts: 20
i have two servers. one running the dnas server and the other running sambar. the only load the dnas server will get is what you mentioned above about bandwidth. but this caching of the picture interests me. anywhere you can direct me to a thread or site for help on it?
MrOuija is offline   Reply With Quote
Old 16th July 2003, 05:13   #26
Jay
Moderator Alumni
 
Jay's Avatar
 
Join Date: May 2000
Location: Next Door
Posts: 8,941
yea I was talking about the webserver itself not shoutcast, it will not take many connections before your webserver starts getting bogged down trying to render an image.

Visit php.net and lookup the function
ImageJpeg
You can force the image be saved to the hard disk using the optional Filename string parameter, rather then displayed.
Jay is offline   Reply With Quote
Old 16th July 2003, 12:58   #27
WEBcast
Junior Member
 
Join Date: Jul 2003
Posts: 19
THIS IS MY CODE please read more careful all the posts and see what is mine.

The Problem with link in UserAgent is from vBulletin automaticly make something like www.webcast.ro in to a web link.

This Script is tested with Windows+IIS+PHP v5.0.0b1 and RedHat9+Apache+PHP v4.2.2 and is working.

When editing this script fallow "//start edit..." & "//stop edit..." use Notepade or a plain text editor

This script is designed for a small network not for heavy trafic
If you have problems with my script send me a email at radu@webcast.ro or Private Message

See this script working here: http://radio.webcast.ro/tools/7.php

PHP Code:
<?php
  
///////////////////////////////////////////
 // Author: Radu Bighiu - [email]radu@webcast.ro[/email] //
///////////////////////////////////////////

//start edit below
$host "webcast.ro";
$port "8000";
//stop editing from here

$fp=fsockopen($host,$port,&$errno,&$errstr,10);
 if (!
$fp) {
echo 
"Can't connect";
}
fputs($fp,"GET /7 HTTP/1.1\nUser-Agent:WEBcast Media Mozilla\n\n");
for(
$i=0$i<30$i++) {
if(
feof($fp)) break;
$fp_data=fread($fp,31337);
usleep(500000);
 }
$fp_data=ereg_replace("^.*<body>","",$fp_data);
$fp_data=ereg_replace("</body>.*","",$fp_data);
list(
$current,$status,$peak,$max,$unique,$bitrate,$song) = explode(","$fp_data);
if (
$status == "0") {
echo 
"<center>Off Air</center>";
} else {
echo 
"<TABLE>";

//start edit below - comment with "//" unnecessary lines
echo "<TR><TD>Current Listeners: </TD><TD>".$current."</TD></TR>";
//echo "<TR><TD>Server Status: </TD><TD>".$status."</TD></TR>";
echo "<TR><TD>Listener Peak: </TD><TD>".$peak."</TD></TR>";
echo 
"<TR><TD>Supported Listeners: </TD><TD>".$max."</TD></TR>";
echo 
"<TR><TD>Unique Listeners: </TD><TD>".$unique."</TD></TR>";
echo 
"<TR><TD>Stream Bitrate: </TD><TD>".$bitrate." kbps</TD></TR>";
echo 
"<TR><TD>Current Song: </TD><TD>".$song."</TD></TR>";
//stop editing from here

echo "</TABLE>";

//start edit below - comment with "//" next line to stop scrolling
echo "<marquee>".$song."</marquee>";
//stop editing here
}
?>
WEBcast is offline   Reply With Quote
Old 16th July 2003, 13:02   #28
Jay
Moderator Alumni
 
Jay's Avatar
 
Join Date: May 2000
Location: Next Door
Posts: 8,941
your code has a flaw, remove the HTML from the User-Agent area, and change the protocal version to 1.0, and use proper linefeeds so
code:

fputs($fp,"GET /7 HTTP/1.1\nUser-Agent:WEBcast Mozilla - <a href="http://www.webcast.ro\n\n" target="_blank">www.webcast.ro\n\n</a>");


reads as
code:

fputs($fp,"GET /7 HTTP/1.0\r\nUser-Agent:WEBcast Mozilla\r\n\r\n");

Jay is offline   Reply With Quote
Old 27th July 2003, 20:42   #29
eccentricbeats
Junior Member
 
Join Date: Jul 2003
Location: Twin Cities, MN
Posts: 17
Send a message via AIM to eccentricbeats
Here is my phpinfo: http://www.eccentricbeats.com/phpinfo.php

Here is my code:

<?php
///////////////////////////////////////////
// Author: Radu Bighiu - radu@webcast.ro //
///////////////////////////////////////////

//start edit below
$host = "24.118.66.43";
$port = "8000";
//stop editing from here

$fp=fsockopen($host,$port,&$errno,&$errstr,10);
if (!$fp) {
echo "Can't connect";
}
fputs($fp,"GET /7 HTTP/1.1\nUser-Agent:WEBcast Media Mozilla\n\n");
for($i=0; $i<30; $i++) {
if(feof($fp)) break;
$fp_data=fread($fp,31337);
usleep(500000);
}
$fp_data=ereg_replace("^.*<body>","",$fp_data);
$fp_data=ereg_replace("</body>.*","",$fp_data);
list($current,$status,$peak,$max,$unique,$bitrate,$song) = explode(",", $fp_data);
if ($status == "0") {
echo "<center>Off Air</center>";
} else {
echo "<TABLE>";

//start edit below - comment with "//" unnecessary lines
echo "<TR><TD>Current Listeners: </TD><TD>".$current."</TD></TR>";
//echo "<TR><TD>Server Status: </TD><TD>".$status."</TD></TR>";
echo "<TR><TD>Listener Peak: </TD><TD>".$peak."</TD></TR>";
echo "<TR><TD>Supported Listeners: </TD><TD>".$max."</TD></TR>";
echo "<TR><TD>Unique Listeners: </TD><TD>".$unique."</TD></TR>";
echo "<TR><TD>Stream Bitrate: </TD><TD>".$bitrate." kbps</TD></TR>";
echo "<TR><TD>Current Song: </TD><TD>".$song."</TD></TR>";
//stop editing from here

echo "</TABLE>";

//start edit below - comment with "//" next line to stop scrolling
echo "<marquee>".$song."</marquee>";
//stop editing here
}
?>

Here is what my output looks like:

Can't connect
Warning: fputs(): supplied argument is not a valid File-Handle resource in /home/eccentricbeats.com/httpdocs/playingnow.php on line 15

Warning: feof(): supplied argument is not a valid File-Handle resource in /home/eccentricbeats.com/httpdocs/playingnow.php on line 17

Warning: fread(): supplied argument is not a valid File-Handle resource in /home/eccentricbeats.com/httpdocs/playingnow.php on line 18

It keeps going and going from there.......
eccentricbeats is offline   Reply With Quote
Old 28th July 2003, 15:39   #30
WEBcast
Junior Member
 
Join Date: Jul 2003
Posts: 19
Quote:
Originally posted by eccentricbeats
Here is my phpinfo: http://www.eccentricbeats.com/phpinfo.php

$host = "24.118.66.43";
$port = "8000";

Here is what my output looks like:

Can't connect
Warning: fputs(): supplied argument is not a valid File-Handle resource in /home/eccentricbeats.com/httpdocs/playingnow.php on line 15

Warning: feof(): supplied argument is not a valid File-Handle resource in /home/eccentricbeats.com/httpdocs/playingnow.php on line 17

Warning: fread(): supplied argument is not a valid File-Handle resource in /home/eccentricbeats.com/httpdocs/playingnow.php on line 18

It keeps going and going from there.......
You have to have the Shoutcast server running, my script uses http://$host:$port/7.html (In your case if http://24.118.66.43:8000/7.html is working then and my script is working good
WEBcast is offline   Reply With Quote
Old 28th July 2003, 21:11   #31
eccentricbeats
Junior Member
 
Join Date: Jul 2003
Location: Twin Cities, MN
Posts: 17
Send a message via AIM to eccentricbeats
I turned off the server because I wasn't running it, I still have probelms with the script even after turning the server on, please check your email that I sent.
eccentricbeats is offline   Reply With Quote
Old 1st August 2003, 04:42   #32
li1997
Member
 
Join Date: Nov 2000
Location: Narragansett, RI, USA
Posts: 78
Send a message via AIM to li1997
Quote:
Originally posted by WEBcast
<?php
///////////////////////////////////////////
// Author: Radu Bighiu - radu@webcast.ro //
///////////////////////////////////////////

//edit below
$host = "webcast.ro";
$port = "8000";
//stop editing from here

$fp=fsockopen($host,$port,&$errno,&$errstr,10);
if (!$fp) {
echo "Can't connect";
}
<--EDIT-->
You know if you are gonna "borrow" someones code and just change the html and remove the comments... you MIGHT wanna mention that somewhere.
ya...

-L"k"
li1997 is offline   Reply With Quote
Old 1st August 2003, 04:58   #33
Jay
Moderator Alumni
 
Jay's Avatar
 
Join Date: May 2000
Location: Next Door
Posts: 8,941
ah come on that's one function call and a if statment, jeepers. I wouldn't hold that against someone if they took one function call and an if statement from my scripts.
Jay is offline   Reply With Quote
Old 3rd August 2003, 22:33   #34
li1997
Member
 
Join Date: Nov 2000
Location: Narragansett, RI, USA
Posts: 78
Send a message via AIM to li1997
Quote:
Originally posted by KXRM
ah come on that's one function call and a if statment, jeepers. I wouldn't hold that against someone if they took one function call and an if statement from my scripts.
To be exact, the only thing you changed was...

put your own comments in
changed the User Agent
and some of the output HTML (which an end user would do anyways)

....
li1997 is offline   Reply With Quote
Old 9th August 2003, 00:22   #35
djmaze
Junior Member
 
Join Date: Jun 2003
Posts: 11
Why are you doing a lot heavy calls to the shout server?

My application MP3 Tunes v2 can stream the "Artist - Title" to a shoutserver AND webpage for example it does a call to:

track.php?artist=

then that php saves the info to a file/database
then put a call in your index.php (or something) to read database/file

this way you won't have to call shout server.

See it in action on http://www.radiogetswild.com when a DJ is playing info will be shown in top-right.

http://www.mp3tunes.nl the way music playin should be.
djmaze is offline   Reply With Quote
Old 19th July 2006, 08:41   #36
Medz
Junior Member
 
Join Date: Jul 2006
Posts: 11
Send a message via Yahoo to Medz
Why bother with some complicated scripts??

All I did was install "RadioToolBox", did a little html editing and "voila!". Nice and neat, check it out.

http://g3d.mine.nu
Medz is offline   Reply With Quote
Old 19th July 2006, 08:42   #37
Medz
Junior Member
 
Join Date: Jul 2006
Posts: 11
Send a message via Yahoo to Medz
DOH!
I've just noticed when the last msgs were posted on..
Ancient History,
silly me.
Medz is offline   Reply With Quote
Old 3rd October 2009, 23:46   #38
USnetworks
Junior Member
 
Join Date: Oct 2009
Posts: 1
how do i see this?

i can't see the message
USnetworks is offline   Reply With Quote
Old 26th April 2010, 01:45   #39
filipeperes
Junior Member
 
Join Date: Apr 2010
Posts: 1
Only works at localhost

Hey guys, i got a little problem, testing scripts like those you posted here, they only works at my localhost, when i upload them to my web host they never get the streaming info, they always show server disconnected, like if i wasnt broadcasting, but i tested in my localhost and the script worked nice, i already CHMOD the folder of the script but still doesnt work, any other solutions?

Thanks
filipeperes 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