Shoutcast Server Stats

Discussion in 'PHP' started by Yonder, Oct 23, 2011.

  1. #1
    Currently i created a custom script to gather some information from remote shoutcast servers.

    It works perfectly for a few hours, but for some reason every now and then it stops working, i have to reupload the files to have it working again. Im not sure it its something to do with ports here is an example, any ideas what would be causing this server side would be great.

    <html><head>
    <meta http-equiv="refresh" content="60">
    <STYLE TYPE="text/css"> 
    <!-- 
    
    body, html
    {
    font-family: "Lucida Grande", "Verdana", "Tahoma"; /** OW_Control type:font, section:1. General Settings, key:commonFontFamily, label:Font **/
    color: #333; /** OW_Control type:color, section:2. Colors, key:textColor, label: - Text **/
    font-size: 13px; /** OW_Control type:text, section:1. General Settings, key:commonFontSize, label:Font size **/
    line-height: 18px;
    }
    </style>
    </head>
    <body>
    <?php
    
    ini_set("user_agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)");
    $html = file_get_contents("http://cast.great.la:1330/7.html"); 
    
    $data = $html;
    
    $data = ereg_replace(".*<body>", "", $data);
    $data = ereg_replace("</body>.*", ",", $data);
    $data_array = explode(",",$data);
    $listeners = $data_array[0];
    $status = $data_array[1];
    $peak_listeners = $data_array[2];
    $maximum_listeners = $data_array[3];
    $unique_listeners = $data_array[4];
    $bitrate = $data_array[5];
    $track = $data_array[6];
    
    
    $title = chop($track);
    $select = explode(" - ",$title);
    $artist = chop($select[0]);
    $title = chop($select[1]);
    
    if (1 == $data_array[1]) {
    
    
    print '<b>Listeners:</b> ' . $data_array[0] . '<br/><b>Song:</b> ' . $data_array[6] . '';
    
    
    } else {
    print '<b>Radio Offline</b>';
    
    }
    
    ?>
    </body>
    </html>
    PHP:
    I am not sure if it a PHP issue or maybe a server issue. I am with host gator level 3 vps with cpanel if that makes a difference, i am also waiting for a response from my Host but i thought id come here and see if anyone has any ideas too.

    Thank you.
     
    Yonder, Oct 23, 2011 IP