Results 1 to 6 of 6
  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.

  2. #2
    joint's Avatar
    Title
    Junior Broadcaster
    Join Date
    Nov 2013
    Posts
    53
    Rep Power
    7
    Nice PHP script

    Thanks!

  3. #3

    Title
    Junior Member
    Join Date
    Jan 2014
    Location
    United Kingdom
    Posts
    20
    Rep Power
    6
    Does this only work with SHOUTcast V1? Considering I suppose for V2 you'd have to provide the sID etc?

  4. #4
    RadioCast's Avatar
    Title
    Member
    Join Date
    Nov 2013
    Location
    Pakistan
    Posts
    31
    Rep Power
    6
    Quote Originally Posted by SHOUTca.st View Post
    Does this only work with SHOUTcast V1? Considering I suppose for V2 you'd have to provide the sID etc?
    Yes Its working with SHOUTcast v2 as well

  5. #5

    Title
    Junior Member
    Join Date
    Jan 2014
    Location
    United Kingdom
    Posts
    20
    Rep Power
    6
    Ah fantastic, did you write the code or is it from the internet?

  6. #6

    Title
    Junior Broadcaster
    Join Date
    Apr 2019
    Posts
    1
    Rep Power
    0
    How to use the same to show the music cover the photo of the singer

    this really only works with SHOUTcast V1

    Mostre-me como funciona com o SHOUTcast v2 também?
    Last edited by MarcAlle; 05-02-2019 at 02:54 AM.

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
  •