Welcome to Geeklog Thursday, May 19 2022 @ 05:24 am EDT
Geeklog Forums
shoutcast/icecast radio block
Status: offline
nobese
Forum User
Chatty
Registered: 20/01/06
Posts: 44
Function phpblock_radio () {
// Fill in your own server information here:
$host = "89.149.217.39";
$port = "8001";
$listenlink = 'http://89.149.217.39:8001/mulksuz.m3u'; //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 .= "Mulksuzler Radyo dinlemektesiniz<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 .= "Mulksuzler Radyoda simdi";
$display .= "Yayin Yok.";
$display .= "Sonra gene deneyin.";
$display .=":::";
}
return $display;
}
// Fill in your own server information here:
$host = "89.149.217.39";
$port = "8001";
$listenlink = 'http://89.149.217.39:8001/mulksuz.m3u'; //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"

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 .= "Mulksuzler Radyo dinlemektesiniz<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 .= "Mulksuzler Radyoda simdi";
$display .= "Yayin Yok.";
$display .= "Sonra gene deneyin.";
$display .=":::";
}
return $display;
}
1
2
Quote
Kunthar
Anonymous
You have to use curl to get server status, playlist etc. from Icecast servers.
This code has nothing to do...
This code has nothing to do...
1
4
Quote
Sodah
Anonymous
Hi,
use this: http://shoutcast.sodah.de/#/House/6668/
<param name="movie" value="http://shoutcast.sodah.de/shoutcast.swf?swfgenre=House&swfchannel=6668"/>
</param>
<embed src="http://shoutcast.sodah.de/shoutcast.swf?swfgenre=House&swfchannel=6668"
type="application/x-shockwave-flash"width="240" height="200"></embed></object>
use this: http://shoutcast.sodah.de/#/House/6668/
PHP Formatted Code
<object width="240" height="200" type="application/x-shockwave-flash"><param name="movie" value="http://shoutcast.sodah.de/shoutcast.swf?swfgenre=House&swfchannel=6668"/>
</param>
<embed src="http://shoutcast.sodah.de/shoutcast.swf?swfgenre=House&swfchannel=6668"
type="application/x-shockwave-flash"width="240" height="200"></embed></object>
2
3
Quote
All times are EDT. The time is now 05:24 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content