cyber_Ahn

SL_Stream_Info

Mar 30th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.82 KB | None | 0 0
  1. <link rel=stylesheet href="../liberay/style.css" type="text/css">
  2. <?php
  3. function getPage($web)
  4.     {
  5.         $html = "";
  6.           $ch = curl_init($web);
  7.           curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.12) Gecko/20070508 Firefox/1.5.0.12");
  8.           curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  9.           curl_setopt($ch, CURLOPT_HEADER, 0);
  10.           //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  11.           curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
  12.           curl_setopt($ch, CURLOPT_TIMEOUT, 5);
  13.           $html = curl_exec($ch);
  14.           if(curl_errno($ch))
  15.           {
  16.               $html = "";
  17.           }
  18.           curl_close ($ch);
  19.         return $html;
  20.     }
  21.     function getBetween($content,$start,$end)
  22.     {
  23.         $a1 = strpos($content,$start);
  24.         $content = substr($content,$a1 + strlen($start));
  25.         while($a2 = strrpos($content,$end))
  26.         {
  27.             $content = substr($content,0,$a2);
  28.         }
  29.         return $content;
  30.     }
  31.  
  32. $ip = $_GET["ip"];
  33. $port = $_GET["port"];
  34. $stream_search = $ip.":".$port;
  35. $data = getPage($stream_search);
  36. $stream_title = getBetween($data,'Stream Title: </font></td><td><font class=default><b>','</b></td></tr><tr><td width=100 nowrap><font class=default>Cont');
  37. $stream_status = getBetween($data,'Stream Status: </font></td><td><font class=default><b>','</b></b></td></tr><tr><td width=100 nowrap>');
  38. $current_song = getBetween($data,'Current Song: </font></td><td><font class=default><b>','</b></td></tr></table><br><table cellpadding=0');
  39. $listener_peak = getBetween($data,'with <B>',' of');
  40. $stream_last = $ip.":".$port."/played.html";
  41. $data_last = getPage($stream_last);
  42. $last_song = getBetween($data_last,'Current Song</b></td></tr><tr><td>','</tr></table><br><br><table cellpadding=0');
  43.  
  44. echo"strema_title:".$stream_title."|stream_status:".$stream_status."|listener_peak:".$listener_peak."|current_song:".$current_song."|last_song<".$last_song;
  45. ?>
Add Comment
Please, Sign In to add comment