Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function listenersIP(){
- $auth = sprintf("Authorization: Basic %s\r\n", base64_encode(ICECAST_ADMIN_USER.':'.ICECAST_ADMIN_PASS));
- $context = stream_context_create(array(
- 'http' => array(
- 'header' => $auth
- )
- ));
- var_dump($auth);
- var_dump($context);
- //ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10');
- $d = file_get_contents(USERS_XML_ICECAST_FEED, false, $context);
- var_dump($d);
- if (!$d)
- return false; // Failed to open connection
- $icecast_listeners_xml = new SimpleXMLElement($d);
- foreach ($icecast_listeners_xml->source[0]->listener as $listener) {
- $ips[] = $listener->IP;
- }
- return $ips;
- }
Add Comment
Please, Sign In to add comment