Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $icecast_url='http://10.10.0.1:8000';
- $output = file_get_contents($icecast_url);
- $search='#<div class="newscontent">.*?Point /(.*?)<.*?href="(.*?)">M3U<.*?Listeners.*?class="streamdata">(.*?)<.*?Song:.*?class="streamdata">(.*?)<.*?</div>#si';
- preg_match_all($search, $output, $matches);
- $j=count($matches[0]);
- for ($i=0;$i<$j; $i++) {
- $point_name=$matches[1][$i];
- $pount_m3u=$icecast_url.$matches[2][$i];
- $point_listners_count=$matches[3][$i];
- $point_current_song=$matches[4][$i];
- //
- echo 'mount point: <b>'.$point_name.'</b>
- ';
- echo 'm3u: <a href="'.$pount_m3u.'">'.$pount_m3u.'</a>
- ';
- echo 'listners_count: <b>'.$point_listners_count.'</b>
- ';
- echo 'point_current_song: <b>'. $point_current_song.'</b>
- ';
- }
- ?>
Advertisement
Advertisement