Guest User

Untitled

a guest
Jul 5th, 2012
502
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $icecast_url='http://10.10.0.1:8000';
  3.  
  4. $output = file_get_contents($icecast_url);
  5.  
  6. $search='#<div class="newscontent">.*?Point /(.*?)<.*?href="(.*?)">M3U<.*?Listeners.*?class="streamdata">(.*?)<.*?Song:.*?class="streamdata">(.*?)<.*?</div>#si';
  7. preg_match_all($search, $output, $matches);
  8.  
  9. $j=count($matches[0]);
  10. for ($i=0;$i<$j; $i++) {
  11.  
  12. $point_name=$matches[1][$i];
  13. $pount_m3u=$icecast_url.$matches[2][$i];
  14. $point_listners_count=$matches[3][$i];
  15. $point_current_song=$matches[4][$i];
  16. //
  17. echo 'mount point: <b>'.$point_name.'</b>
  18. ';
  19. echo 'm3u: <a href="'.$pount_m3u.'">'.$pount_m3u.'</a>
  20. ';
  21. echo 'listners_count: <b>'.$point_listners_count.'</b>
  22. ';
  23. echo 'point_current_song: <b>'. $point_current_song.'</b>
  24.  
  25.  
  26. ';
  27. }
  28. ?>
RAW Paste Data