Some questions regarding PHP Scripts
Please don't use the forums to report outages, particularly if you are a FreeStreamHosting.org user.
Some questions regarding PHP Scripts
or whoever that is reading my post,
I have some questions regarding PHP Scripts,
1. if we go to Statistics page in ShoutCast control panel, we'll see this:
Stream Info: Stream status, Stream title, Now playing, Genre, Content type, Time GMT
is it possible to get the Stream title into variable in PHP?
2. based on your guidance in Tune in links & scripts:
- Code: Select all
if (!$fp)
$song = "Connection timed out or the server is offline ";
else {
fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
while (!feof($fp))
$info = fgets($fp);
$split = explode(',', $info);
for($i=0;$i<sizeof($split);$i++)
echo '$split['.$i.'] = '.$split[$i].'<br />';
}
the output would be:
- Code: Select all
$split[0] = 1
$split[1] = 1
$split[2] = 1
$split[3] = 1000
$split[4] = 1
$split[5] = 56
$split[6] = F.T ISLAND (에프티 아일랜드) - 나쁜 여자야
if [0] is the number of listeners, and [1] is the stream status,
so, what are [2] and [4]??
I really have no idea with [2],,
and [4] keeps returning the same value as [0]
3. is there another info that I could get into PHP variable?
4. idk what's going on, when I tested the script on remote server, $fp keeps returning "false". but this never happened when I tested the script on my localhost.
5. is it possible to disable the instant chatbox on http://s3.myradiostream.com/stream/{id#}/listen.htm ?
6. is it possible to get the embedded flash player alone? of course, I'll never remove any of your advertisements.
thank you in advance,
- hKyo89
- Posts: 2
- Joined: Sat 14th Nov, 2009 9:50 am
Re: Some questions regarding PHP Scripts
1. The Stream Title isn't available using the scripts provided, but here's an alternative that should work:
- Code: Select all
<?php
$ip = "YOUR SERVER HOST / IP";
$port = "SERVER PORT";
$fp = @fsockopen($ip,$port,$errno,$errstr,1);
if (!$fp) {
$streamtitle = "Connection timed out or the server is offline";
} else {
fputs($fp, "GET /index.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
while (!feof($fp)) {
$info = fgets($fp);
}
$info = str_replace('</body></html>', "", $info);
$split = explode('Stream Title: </font></td><td><font class=default><b>', $info);
$split = explode('</b></td></tr><tr>', $split[1]);
$streamtitle = $split[0];
}
if ($streamtitle) {
print $streamtitle;
} else {
print "The stream title is currently empty";
}
?>
2. The variables are as follows:
$split[0] = Total listener connections*
$split[1] = Status (1 = online / 2 = offline)
$split[2] = Listener peak (since server started)
$split[3] = Maximum listeners
$split[4] = Unique listener connections*
$split[5] = Current bitrate
$split[6] = Song title
* Total and Unique listener connections:
Total is the total number of connections to the server
Unique is the number of unique IP addresses connected
These can differ if there are 2 people on the same IP listening (or both behind the same proxy) or if someone is stream ripping.
3. Not with the script supplied, the only variables are above. You could edit the script I gave in (1) to get other info that's listed on
4. This normally means that your webhost has a firewally which blocks outgoing connections. If you ask them about it, they might unblock the connection for you.
5. That is something that I'm going to do this week. I wanted to test the chatbox for a few days to make sure it works when there are a lot of users viewing.
6. There is a free version of the flash player here http://www.draftlight.net/dnex/mp3player/minicaster/
We use the paid one, so there might be small differences.
Also, if you embed that you will need the ad code as well which is also available in the scripts area.
I hope that answers everything.
Customer Support: https://secure.bellonline.co.uk/submitticket.php
FreeStreamHosting Support: http://freestreamhosting.org/support.php
Sales: https://secure.bellonline.co.uk/contact.php
- Gavin
- Site Admin
- Posts: 346
- Joined: Thu 01st Jan, 1970 1:00 am
Re: Some questions regarding PHP Scripts
I'll test the script you gave above,,
please do not close this thread,,
there maybe another question regarding this,, ^^
about the flash player,
I even put your ad in my header,,
so it always appear anytime everywhere,
even when you are not opening the player,, lol,,
you can check it here:
http://rss-onair.hkyo89.com
really really really thank you!
- hKyo89
- Posts: 2
- Joined: Sat 14th Nov, 2009 9:50 am
Re: Some questions regarding PHP Scripts
Thank you for supporting the service.
Customer Support: https://secure.bellonline.co.uk/submitticket.php
FreeStreamHosting Support: http://freestreamhosting.org/support.php
Sales: https://secure.bellonline.co.uk/contact.php
- Gavin
- Site Admin
- Posts: 346
- Joined: Thu 01st Jan, 1970 1:00 am
Re: Some questions regarding PHP Scripts
as the issues are being discussed here, I thought I would reply rather than add a new topic.
On searching and customising the flash player, I downloaded that free player, but cannot get it working!
If i can get it working were going to go up to the paid one. Here is where I have placed the script to test, and as you see if you try
http://www.onemediaradio.com/cast/
i get:
100:-#- FMP256 Minicaster FREE v4.32c -#-
113:setconfig registered to JavaScript
113:playpause registered to JavaScript
114:Config file loaded and accepted
104:Config defines DNAS playlist file: http://www.onemediaradio.com/cast/listen.pls
105:Config defines info website: http://www.onemediaradio.com
106:Config defines stream title: One Media Radio from Staffordshire University
108:Volume set to 80% by config file
110:DNAS playlist file loaded OK
111:DNAS playlist file parsed OK - 1 entries
120:LOADING 'http://uk3-vn.mixstream.net:8116/' slot=0 XFade=true
121:Stream loaded OK
109:Slot 0 status: Bytes Loaded=4923, Position=0, Duration=0
109:Slot 0 status: Bytes Loaded=4923, Position=0, Duration=0
109:Slot 0 status: Bytes Loaded=4923, Position=0, Duration=0
109:Slot 0 status: Bytes Loaded=4923, Position=0, Duration=0
109:Slot 0 status: Bytes Loaded=4923, Position=0, Duration=0
109:Slot 0 status: Bytes Loaded=4923, Position=0, Duration=0
504:Content of stream does not seem to be music
501:Audio stopped [undefined]
my xml file is:
- Code: Select all
<?xml version="1.0" encoding="iso-8859-1" ?>
<config version="1s" xmlns="http://www.draftlight.net/dnex/config/ns/0/">
<mp3cast>
<playlist>http://www.onemediaradio.com/cast/listen.pls</playlist>
<website>http://www.onemediaradio.com</website>
<title>One Media Radio from Staffordshire University</title>
</mp3cast>
<init autoplay="0" volume="80" reload="10" xfade="1" />
</config>
What am I doing wrong?! However, what I want to achieve is the full player with scrolling data from the server, but NO listener counts. And if i can add a second back up stream / or stream option, even better.
I am pretty literate in internet computing, however this is totally stumping me!!!
Any help and assistance would be much appreciated.
Pete
- onemediapete
- Posts: 2
- Joined: Sat 28th Nov, 2009 9:53 am
Re: Some questions regarding PHP Scripts
So the only thing I'm struggling to get is the now playing info on the flash player.
Please can you help?
- onemediapete
- Posts: 2
- Joined: Sat 28th Nov, 2009 9:53 am
Re: Some questions regarding PHP Scripts
If you're using the paid service then there should be some javascript that you can put onto your page for the player - that might be the best way.
Customer Support: https://secure.bellonline.co.uk/submitticket.php
FreeStreamHosting Support: http://freestreamhosting.org/support.php
Sales: https://secure.bellonline.co.uk/contact.php
- Gavin
- Site Admin
- Posts: 346
- Joined: Thu 01st Jan, 1970 1:00 am
Re: Some questions regarding PHP Scripts
- shawn
- Posts: 3
- Joined: Sun 29th Nov, 2009 7:25 am
- Location: LAS VEGAS
Return to Streaming Discussion
-
- Related topics
- Replies
- Views
- Last post
-
- A Few Questions
by DeeJayMike » Tue 21st Dec, 2010 5:26 pm - 3 Replies
- 300 Views
- Last post by Gavin

Thu 20th Jan, 2011 1:35 pm
- A Few Questions
-
- Few questions before signing up...
by capsfanalex » Sun 30th Jan, 2011 6:22 am - 2 Replies
- 221 Views
- Last post by Gavin

Wed 02nd Feb, 2011 4:54 pm
- Few questions before signing up...
-
- Issue with scripts
by meelismalgand » Wed 28th Jul, 2010 11:54 am - 4 Replies
- 496 Views
- Last post by Gavin

Sun 01st Aug, 2010 4:19 pm
- Issue with scripts
-
- Tune In PHP Scripts not working
by REY619 » Sun 21st Feb, 2010 7:58 am - 1 Replies
- 816 Views
- Last post by Gavin

Sun 28th Feb, 2010 4:04 pm
- Tune In PHP Scripts not working
-
- Website scripts problems!
by atlantis » Sun 18th Apr, 2010 5:31 pm - 0 Replies
- 706 Views
- Last post by atlantis

Sun 18th Apr, 2010 5:31 pm
- Website scripts problems!
Who is online
Users browsing this forum: No registered users and 1 guest

