Results 1 to 6 of 6

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    RadioCast's Avatar
    Title
    Member
    Join Date
    Nov 2013
    Location
    Pakistan
    Posts
    31
    Rep Power
    6

    Post SHOUTcast Song title PHP code

    PHP Code:
    <?php
    $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('</body></html>'""$info);
        
    $split explode(','$info);
        if (empty(
    $split[6])) {
            
    $title "The current song is not available  ";
        } else {
            
    $count count($split);
            
    $i "6";
            while(
    $i<=$count) {
                if (
    $i 6) {
                    
    $title .= ", " $split[$i];
                } else {
                    
    $title .= $split[$i];
                }
                
    $i++;
            }
        }
    }
    $title substr($title0, -2);
    print 
    $title;
    ?>
    Last edited by MarcAlle; 01-19-2014 at 02:54 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •