TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

July 21, 2024, 07:17:36 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,333
  • Total Topics: 21,233
  • Online today: 103
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 39
  • Total: 40
  • @rjen

Shoutcast Block

Started by ontap, September 03, 2005, 04:20:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

timtimtim

Wow - that's crazy. Now I put my settings in and try it again it works perfectly! Thanks for replying and giving me the desire to give it another shot :D

pheadrus

This snippet is not working at my site. Although I have made the correct settings (From Winamp, I can listen the radio which settings are the same at the php-block) , It gives me error . I also tried for many radios.
What can be done  ???

Thnx...

Max

#12
Quote from: pheadrus on June 19, 2006, 05:48:14 PM
This snippet is not working at my site.

it should work when you put in the shoutcast server settings correctly.

what is your shourcast URL?

erikman

 :D :D

Using on my site!
Fine script!

pheadrus

#14
Quote from: Maxâââ,¬Å¾Ã,¢ on June 19, 2006, 06:25:42 PM
it should work when you put in the shoutcast server settings correctly.

what is your shourcast URL?

Host: gunduzgece.no-ip.org
Port: 8000

These values are what I changed in your code. The exact url is that: http://gunduzgece.no-ip.org:8000/listen.pls

Here is my code in a php-block:

//SHOUTcast Block For Tinyportal
// Thanks To Max For Code

// Edit The Next Two Lines With Your SHOUTCAST Server Information
$host = "gunduzgece.no-ip.org";
$port = "8000";

//  Station Name
$streamtitle = "GündüzGece FM";

// Stream Url
$streamurl = "http://$host:$port/listen.pls";

// Connect To SHOUTcast Server
$fp=@fsockopen($host,$port,&$errno,&$errstr,10);
if (!$fp) {
echo "<b>GündüzGece yayında değil!</b>";
} else {

// Get Data From SHOUTcast Server
fputs($fp,"GET /7 HTTP/1.1\nUser-Agent:Mozilla\n\n");

// Exit If Connection Is Broken
for($i=0; $i<1; $i++) {
if(feof($fp)) break;
$fp_data=fread($fp,31337);
usleep(100000);
}

// Strip useless junk from source data
$fp_data=ereg_replace("^.*<body>","",$fp_data);
$fp_data=ereg_replace("</body>.*","",$fp_data);

// Place values from source into variable names
list($current,$status,$peak,$max,$reported,$bit,$song) = explode(",", $fp_data, 7);

if ($status == "1") {
// To use any of the outputs below just uncomment (remove the double forward slashes) that line.
// Below is an example of all data available in the 7.html file made by the Shoutcast server
// **ON BY DEFAULT - COMMENT OUT (put to forwards slashes in front of it) TO HIDE

echo "
<center>Ã...žu an Çalan: $streamtitle
<br>
<marquee>
<a href=\"$streamurl\">$song</a>
</marquee>
Bitrate @ $bit kbps <br> Dinleyici: $current / $max <br>
";
} else {
echo "
<b>$streamtitle Yayında değil</b><br>En son Çalan şarkı:<br>
<marquee>$song</marquee>";
} }

Max

Quote from: pheadrus on June 20, 2006, 02:39:03 PM
The exact url is that: http://gunduzgece.no-ip.org:8000/listen.pls

link dont work.., maybe thats the cause of why its not working?

pheadrus

#16
Quote from: Maxâââ,¬Å¾Ã,¢ on June 20, 2006, 03:05:40 PM

link dont work.., maybe thats the cause of why its not working?

I have let my radio run on my computer (webserver on my computer).  I have tested many many times from office or other IP's. They can listen my radio, but on my forum, shoutcast will not display and says "not connected". When you tried maybe radio was off, because my radio was 2 days on-air (I like this term  :) ) after my question was here written by me.
Like my radio, any radio that I can listen can not be connected via my forum (my forum is NOT hosted on my computer).
This block will be a great modification for me, if I let it work  :)

alan s

i dont believe it....................i've been looking for this script for months and then its here YES!!

Thurnok

Quote from: pheadrus on June 24, 2006, 04:05:26 PM
I have let my radio run on my computer (webserver on my computer).  I have tested many many times from office or other IP's. They can listen my radio, but on my forum, shoutcast will not display and says "not connected". When you tried maybe radio was off, because my radio was 2 days on-air (I like this term  :) ) after my question was here written by me.
Like my radio, any radio that I can listen can not be connected via my forum (my forum is NOT hosted on my computer).
This block will be a great modification for me, if I let it work  :)

I have run a Shoutcast server for quite a long time.  There are a number of scripts out there for various CMS products that show Shoutcast info on your website.  What I have found however, is that not all Hosters allow the fsockopen() function which basically opens a socket from their server to allow you to connect to another server.  Because of this you might not be able to view Shoutcast info on your SMF site if it is hosted by a restrictive hoster.

Muziek4um

Euh.... this is an old message but I came across the same problem. Check out mysite at the top of the right sidebar.

http://www.muziek4um.nl/forum/index.php