$getstr)); $d->get_data_to_string(); $icecast_shitty_page = preg_replace('/<\?xml.*?\?>/', '', $d->get_data()); $doc = phpQuery::newDocument($icecast_shitty_page); $list = $doc->find('table.servers-list')->find('tr'); $page_title = $doc->find('#content')->children('h2')->text(); logger::log("ICESCRAPER", "Page Title Is ".$page_title); $count = 0; directoryControlHeader('icecastlist', get_int_text('label_icecast')); print '
'; print '
'; print '
'.$page_title.'
'; foreach ($list as $server) { $server_web_link = ''; $server_name = pq($server)->find('.stream-name')->children('.name')->children('a'); $server_web_link = $server_name->attr('href'); $server_name = $server_name->text(); logger::log("ICESCRAPER", "Server Name Is ".$server_name); $server_description = munge_ice_text(pq($server)->find('.stream-description')->text()); $stream_tags = array(); $stream_tags_section = pq($server)->find('.stream-tags')->find('li'); foreach ($stream_tags_section as $tag) { $stream_tags[] = pq($tag)->children('a')->text(); } $listeners = pq($server)->find('.listeners')->text(); $listenlinks = pq($server)->find('.tune-in'); $listenlink = ''; $format = ''; $ps = $listenlinks->find('p'); foreach ($ps as $p) { if (pq($p)->hasClass('format')) { $format = pq($p)->attr('title'); } else { foreach(pq($p)->children('a') as $a) { $l = pq($a)->attr('href'); if (substr($l, -5) == ".xspf") { $listenlink = 'http://dir.xiph.org'.$l; } } } } if ($listenlink != '') { print albumHeader(array( 'id' => 'icecast_'.$count, 'Image' => 'newimages/icecast.svg', 'Searched' => 1, 'AlbumUri' => null, 'Year' => null, 'Artistname' => implode(', ', $stream_tags), 'Albumname' => htmlspecialchars($server_name), 'why' => 'whynot', 'ImgKey' => 'none', 'streamuri' => $listenlink, 'streamname' => $server_name, // 'streamimg' => 'newimages/icecast.svg', 'streamimg' => '', 'class' => 'radiochannel' )); print '
'; trackControlHeader('','','icecast_'.$count, array(array('Image' => 'newimages/icecast.svg'))); print '
'; print '
'.$server_description.'
'; print '
'; print '
'.$listeners.'
'; print '
'; print '
'; print 'Listen '.$format; print '
'; print '
'; print ''; print ''; print ''; print '
'; } $count++; } $pager = $doc->find('ul.pager')->children('li'); print '
'; foreach ($pager as $page) { $link = pq($page)->children('a')->attr('href'); print '
'.pq($page)->children('a')->text().'
'; } print '
'; } else { print '
'; print albumHeader(array( 'id' => 'icecastlist', 'Image' => 'newimages/icecast.svg', 'Searched' => 1, 'AlbumUri' => null, 'Year' => null, 'Artistname' => '', 'Albumname' => get_int_text('label_icecast'), 'why' => null, 'ImgKey' => 'none', 'class' => 'radio', 'expand' => true )); print '
'.get_int_text('label_loading').'
'; print '
'; } function munge_ice_text($text) { $monkeyjesus = preg_replace('/(?