Witam, posiadam statystyki shoutcast, i wyswietla się np. ile osób słucha, aktualny tytuł piosenki ale chciałbym pobrać kto słucha (same ip)
np.
133.25
478.64.87.9
435.87.987.6
ilość słuchaczy: 3
<?php
//Dane serwera
$sc[ip]="ip"; //IP serwera do zmiany!
$sc[port]="port"; //Port serwera do zmiany!
$sc[czas] = "60"; //Czas od?wieżania statywu
//Dane statystyk
$sc[table1]="[prezenter][status]";
$sc[table2]="[audycja][status]";
$sc[table3]="[nuta][status]";
$sc[table4]="[ile][status]";
{
fputs($fp,"GET /index.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); fgets($fp);fgets
($fp);fgets
($fp);
// Funkcja [status]
$m[0]="Server is currently";
$m[1]="";
if( $tmp[1][0] == "up" )
$dat[status] = "";
elseif( $tmp[1][0] == "down" )
$dat[status] = "Aktualnie nie nadajemy!";
else
$dat[status] = "Nie prawidłowe dane!";
if($dat[status]=="")
{
// Funkcja [audycja]
$m[0]="Stream Title:";
$m[1]="Content Type:";
$tmp[1
]=trim( substr( $in , $mp[0
] + $ml[0
] , $mp[1
]-$mp[0
]-$ml[1
] ) );
if( $tmp[1] ) $dat[audycja] = $tmp[1];
else $dat[audycja] = "Nie prawidłowe dane!";
// Funkcja [prezenter]
$m[0]="Stream Genre:";
$m[1]="Stream URL:";
$tmp[1
]=trim( substr( $in , $mp[0
] + $ml[0
] , $mp[1
]-$mp[0
]-$ml[1
]-2
) );
if( $tmp[1] ) $dat[prezenter] = $tmp[1];
else $dat[prezenter] = "Nie prawidłowe dane!";
// Funkcja [ile]
$m[0]="kbps with";
$m[1]="listeners";
$tmp[1
]=explode( " " , trim( substr( $in , $mp[0
] + $ml[0
] , $mp[1
]-$mp[0
]-$ml[1
]-2
) ) );
if( $tmp[1] ) $dat[ile] = $tmp[1][0];
else $dat[ile] = "Nie prawidłowe dane!";
// Funkcja [nuta]
$m[0]="Current Song:";
$m[1]="Written by Ste";
$tmp[1
]=trim( substr( $in , $mp[0
] + $ml[0
] , $mp[1
]-$mp[0
]-$ml[1
] ) );
if( $tmp[1] ) $dat[nuta] = $tmp[1];
else $dat[nuta] = "Nie prawidłowe dane!";
}
}
else
{
$dat[status]="err";
}
$co=array('[status]','[audycja]','[prezenter]','[ile]','[nuta]'); $naco=array($dat[status
],$dat[audycja
],$dat[prezenter
],$dat[ile
],$dat[nuta
]);
?>