-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwhats_playing.php
36 lines (32 loc) · 1.26 KB
/
whats_playing.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
// displaying as links song title for four (1,2,3,4) icecast streams
// public domain
//
$result = array();
$handle = @fopen("http://some.address.of.icecast.server:8000/status.xsl","r");
if ($handle) {
$i=0;
while (($buffer = fgets($handle, 4096)) !== false) {
if ($i==68) {
$d = preg_split("/<[^>]*[^\/]>/i",$buffer);
array_push($result,"<a href=\"http://some.address.of.icecast.server:8000/1.m3u\">".$d[1]."</a>");
}
else if ($i==126) {
$d = preg_split("/<[^>]*[^\/]>/i",$buffer);
array_push($result,"<a href=\"http://some.address.of.icecast.server:8000/2.m3u\">".$d[1]."</a>");
}
else if ($i==184){
$d = preg_split("/<[^>]*[^\/]>/i",$buffer);
array_push($result,"<a href=\"http://some.address.of.icecast.server:8000/3.m3u\">".$d[1]."</a>");
}
else if ($i==242) {
$d = preg_split("/<[^>]*[^\/]>/i",$buffer);
array_push($result,"<a href=\"http://some.address.of.icecast.server:8000/4.m3u\">".$d[1]."</a>");
}
$i++;
}
fclose($handle);
foreach ($result as $link)
echo $link."\n";
}
?>