Jump to content

SHOUTcast Song title PHP code


Recommended Posts

$ip = "YOUR IP ADDRESS HERE";
$port = "YOUR PORT NUMBER HERE";
$fp = @fsockopen($ip,$port,$errno,$errstr,1);
if (!$fp) { 
   $title = "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);
   }
   $info = str_replace('
', "", $info);
   $split = explode(',', $info);
   if (empty($split[6])) {
       $title = "The current song is not available  ";
   } else {
       $count = count($split);
       $i = "6";
       while($i            if ($i > 6) {
               $title .= ", " . $split[$i];
           } else {
               $title .= $split[$i];
           }
           $i++;
       }
   }
}
$title = substr($title, 0, -2);
print $title;
?>

Edited by BWorld

SHOUTcast Hosting | Cheap Shoutcast Streaming | ICEcast Hosting |

Money-Back Guarantee | Unlimited Bandwidth|

Radio Cast | Your Stream Solution|

 

Link to comment
Share on other sites

  • 5 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...