///////Отображение ведущего когда он в эфире///////// <?php $handle = fopen("http://100.00.000.00:8008/status2.xsl?mount=/radio", "rb"); //Укажите Ваши ip, порт и основной маунт $contents = ''; while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle); $mas=explode(",",$contents); $dj=$mas[15]; $dj = str_replace ("~", " ICQ: ", $dj); if ($text =='' and $dj=='') { /////////////////////////////////////Отображение Non stop когда нету ведущего///////// $handle = fopen("http://100.00.000.00:8008/status2.xsl?mount=/nonstop", "rb"); //Укажите Ваши ip, порт и нон-стоп маунт $contents = ''; while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle); $mas=explode(",",$contents); $dj='Non Stop'; } echo 'Ведущий: '.$dj; ######################################################################################## //Далее вывод песни которая играет $ip = "100.00.000.00"; //Адрес сервера или IP $port = "8008"; //Порт $ice2_station = "My Radio Station"; //Название станции или маунта ////////////////start the parsin action\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ //opening socket $fp = fsockopen("$ip", $port, &$errno, &$errstr, 30); //open connection if(!$fp) { $success=2; //set if no connection } if($success!=2){ //if connection fputs($fp,"GET /status2.xsl HTTP/1.0\r\nUser-Agent: Icecast2 XSL Parser (Mozilla Compatible)\r\n\r\n"); //get status2.xsl while(!feof($fp)) { $page .= fgets($fp, 1000); } fclose($fp); //close connection $page = ereg_replace(".*<pre>", "", $page); //extract data $page = ereg_replace("</pre>.*", ",", $page); //extract data $numbers = explode(",",$page); //bomb it and extract data $cur_song = $numbers[5]; $cur_song = $numbers[16]; echo'<br/>Сейчас играет: '.$cur_song.''; } ?>
<?php $ch = curl_init (); // инициализация curl_setopt ($ch , CURLOPT_URL , "http://site.ru/inf.php"); // адрес страницы для скачивания curl_setopt ($ch , CURLOPT_USERAGENT , "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.7.12) Gecko/20050919 Firefox/1.0.7"); // каким браузером будем прикидываться (Это наверное не обязательно но я оставил) curl_setopt ($ch , CURLOPT_RETURNTRANSFER , 1 ); // нам нужно вывести загруженную страницу в переменную $content = curl_exec($ch); // скачиваем страницу curl_close($ch); // закрываем соединение echo ''.$content.''; //то что будет отображаться на странице ?>
<html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script> <script type="text/javascript"> var auto_refresh = setInterval( function () { $('#info').load('index.php?_=' +Math.random()).fadeIn("slow"); //#info - div, куда будет выводиться информация (та страница на которой отображается информация) //info.php - скрипт, выводящий необходимую нам информацию }, 150000); //интервал обновления, в миллисекундах </script> </head> <body> <!--Далее пример использования--> <div id="info"> <?php include("info.php"); ?> </div> </body> </html>
<script> function show() { $.ajax({ url: "parse.php", //Тут указываем файл со скриптами cache: false, success: function(html){ $("#content").html(html); } }); } $(document).ready(function(){ show(); setInterval('show()',60000); //Время в милесекундах }); </script> <div id="content">Тут то,чтонадо обновлять</div>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.min.js"></script> <script type="text/javascript"> jQuery(document).ready(function(){ setInterval("jQuery('#timeA').load('# dl#timeB');",60000); }); </script> <dl id="timeA"><dl id="timeB">Тут то, что надо обновлять</dl></dl>
<?php $data = file_get_contents('http://???µ?????µ??:8000/status.xsl?mount=/ZED-FM'); $data2 = file_get_contents('http://???µ?????µ??:8000/status.xsl?mount=/ruskat'); //$data3 = file_get_contents('http://62.149.27.186:8000/status.xsl?mount=/live'); $admdata = file_get_contents('http://?»????????:???°?????»??@???µ?????µ??:8000/admin/stats.xsl?mount=/ZED-FM'); function antara($string, $start, $end){ $string = " ".$string; $ini = strpos($string,$start); if ($ini == 0) return ""; $ini += strlen($start); $len = strpos($string,$end,$ini) - $ini; return substr($string,$ini,$len); } //$data = iconv("utf-8", "cp1251", $data); $admdata = iconv("utf-8", "cp1251", $admdata); $samprate = antara($admdata, "ice-samplerate</td>\n<td class=\"streamdata\">","</td>"); $title = antara($data, "Stream Title:</td>\n<td class=\"streamdata\">","</td>"); $description = antara($data, "Stream Description:</td>\n<td class=\"streamdata\">","</td>"); $content_type = antara($data, "Content Type:</td>\n<td class=\"streamdata\">","</td>"); $Mount_started = antara($data, "Mount started:</td>\n<td class=\"streamdata\">","</td>"); $Bitrate = antara($data, "Bitrate:</td>\n<td class=\"streamdata\">","</td>"); $Current_listeners = antara($data, "Current Listeners:</td>\n<td class=\"streamdata\">","</td>"); $Peak_listeners = antara($data, "Peak Listeners:</td>\n<td class=\"streamdata\">","</td>"); $Stream_genre = antara($data, "Stream Genre:</td>\n<td class=\"streamdata\">","</td>"); $Stream_url = antara($data, "Stream URL:</td>\n<td class=\"streamdata\">","</td>"); $Current_song = antara($data, "Current Song:</td>\n<td class=\"streamdata\">","</td>"); $server_name = antara($admdata, "server_name</td>\n<td class=\"streamdata\">","</td>"); //========???????? ???°?????????? ???µ?????»?????°============// $Current_listeners2 = antara($data2, "Current Listeners:</td>\n<td class=\"streamdata\">","</td>"); $Peak_listeners2 = antara($data2, "Peak Listeners:</td>\n<td class=\"streamdata\">","</td>"); //-----------------// $data3_curr_listeners = antara($data2, "Current Listeners:</td>\n<td class=\"streamdata\">","</td>"); $data3_peak_listeners = antara($data2, "Peak Listeners:</td>\n<td class=\"streamdata\">","</td>"); //======?????????????? ?? ?·?°???°?»?????? ?????»???????????? ???»?????°?????? ???° ????????=======// $Curr_listens=$Current_listeners2+$Current_listeners+$data3_curr_listeners; $Peak_listens=$Peak_listeners2+$Peak_listeners+$data3_peak_listeners; $staylst=$Curr_listens+1; //echo ''.$title.' <br> '.$description.' <br> '.$content_type.' <br> '.$Mount_started.' <br> '.$Bitrate.' <br> '.$Curr_listens.' <br> '.$Peak_listens.' <br> '.$Stream_genre.' <br> '.$Stream_url.' <br> '.$Current_song.' <br><br>???»?????°???? ???? ???°???????°?? <br> //4m ZED-FM: ?·?°???°?· '.$Current_listeners.', ???????????? '.$Peak_listeners.'.<br> //4m ruskat: ?·?°???°?· '.$Current_listeners2.', ???????????? '.$Peak_listeners2.'.<br> //Hellp: ?·?°???°?· '.$data3_curr_listeners.', ???????????? '.$data3_peak_listeners.'.<br> //'; str_replace ('%20','_',$file_name) //$Current_song = iconv("cp1251", "utf-8", $Current_song); echo '<script language=\'JavaScript\' type=\'text/javascript\' src=\'http://ruskat.at.ua/js/tt.js\'></script> <style type="text/css"> #tooltip{ font-family:Courier New; font-size:13px; padding-left: 2px; font-weight:bold;margin:0;padding:0; background: url(http://ruskat.at.ua/img/s5_seg_f.png) repeat-x; border:0px solid #023875; color:#fff; margin:0px; padding:2px 5px; position:absolute; visibility:hidden } </style> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="70"> <marquee behavior="scroll" width="320" scrollamount="4"><font color="orange"> <img src="http://cdn1.iconfinder.com/data/icons/Futurosoft%20Icons%200.5.2/22x22/apps/vlc.png" width="18" height="18" alt="?????°??" /> <b>'.$Current_song.'</b></font> </marquee> <marquee behavior="scroll" width="320" scrollamount="3" direction="left"><font color="lime"><img src="http://cdn1.iconfinder.com/data/icons/iconslandplayer/PNG/128x128/PlainBlue/MicrophonePressed.png" width="20" height="20" alt="???????? ???µ???µ" />'.$description.'. ???????°?? ?????°???????°???? '.$Mount_started.'. ???????µ?? '.$content_type.', ?±???????µ???? '.$Bitrate.' kb/p s, ???°?????????° '.$samprate.' ????. <b style= "color:#FA0000; background:#fff"><img src="http://www.iconsearch.ru/uploads/icons/futurosoft_icons/32x32/audacity.png" width="18" height="18" alt="???»?????°??????" /></b> <b style= "color:#fff; background:#3C52E3"> '.$Curr_listens.' </b>. ???°???±???»?????µ c?»?????°?»?? <b style= "color:#FA0000; background:#fff"> '.$Peak_listens.' </b>. ?????°???? <a href=\'\'onclick=\'javascript:window.open("http://ruskat.at.ua/radio/listen.html", "mywindow","toolbar=1,menubar=1,resizable=1,width=350,height=250");\'> <b style= "color:#FA0000; background:#fff"> '.$staylst.'-?? ???»?????°???µ?? </b></a>!</font></marquee> </td> <td align="right"><div align="center"><font color="white"> ???°?????? ??????????'; //???µ?»?°?µ?? ?·?°???µ???? ???????????»????// $Current_song = str_replace(array('\'', '&', '&'), '', trim($Current_song)); $Current_song=preg_replace('/\s+/', ' ', $Current_song); //$Current_song = ereg_replace('[\'&]+', '', $Current_song); //?????µ?»?°?»?? ?·?°???µ???? ???????????»????// //$Current_song = iconv("cp1251", "utf-8", $Current_song); echo'<a href=\'\' onclick=\'javascript:window.open("http://muzgruz.ru/search/?section=audio&q='.$Current_song.'", "mywindow","toolbar=1,menubar=1,resizable=1,Scrollbars=1,width=850,height=400");\'><img src="http://cdn1.iconfinder.com/data/icons/DarkGlass_Reworked/128x128/apps/audacity.png" width="16" height="16" alt="?????°???°???? ???µ?????? '; //$Current_song = iconv("utf-8", "cp1251", $Current_song); echo''.$Current_song.' ???° ?????·???????·" /></a> <a href=\'\' onclick=\'javascript:window.open("http://vkontakte.ru/gsearch.php?section=audio&q='.$Current_song.'&name=1", "mywindow","toolbar=1,menubar=1,resizable=1,Scrollbars=1,width=850,height=400");\'><img src="http://ruskat.at.ua/img/vkontakte-512x512.png" width="16" height="16" alt="???????°???? ???µ?????? '.$Current_song.' ???????????°?????µ" /></a> ?? ???????µ?? '; //$Current_song = iconv("cp1251", "utf-8", $Current_song); echo'<a href=\'\' onclick=\'javascript:window.open("http://www.youtube.com/results?search_query='.$Current_song.'&aq=f", "mywindow","toolbar=1,menubar=1,resizable=1,Scrollbars=1,width=850,height=400");\'><img src="http://s.ytimg.com/yt/favicon-vflZlzSbU.ico" width="" height="" alt="???????°???? ???»???? '; //$Current_song = iconv("utf-8", "cp1251", $Current_song); echo ''.$Current_song.' ???° YouTube" /></a>'; //RUtube //$Current_song = iconv("utf-8", "koi8-r", $Current_song); $Current_song = mb_convert_encoding($Current_song, "utf-8", "koi8-r"); echo'<a href=\'\' onclick=\'javascript:window.open("http://rutube.ru/search.html?page=index&search='.$Current_song.'&search_type=track", "mywindow","toolbar=1,menubar=1,resizable=1,Scrollbars=1,width=850,height=400");\'><img src="http://rutube.ru/favicon.ico" width="" height="" alt="???????°???? ???»???? '; $Current_song = mb_convert_encoding($Current_song, "koi8-r", "utf-8"); //$Current_song = iconv("koi8-r", "utf-8", $Current_song); echo ''.$Current_song.' ???° RUtube" /></a>'; echo'<a href=\'\' onclick=\'javascript:window.open("http://vkontakte.ru/gsearch.php?section=video&q='.$Current_song.'&name=1", "mywindow","toolbar=1,menubar=1,resizable=1,width=850,height=400");\'><img src="http://ruskat.at.ua/img/vkontakte-512x512.png" width="16" height="16" alt="???????°???? ???????µ?? '.$Current_song.' ???????????°?????µ" /></a><br> ?° ???°?? ?¶?µ <a href=\'\' onclick=\'javascript:window.open("http://www.google.com.ua/search?client=opera&rls=ru&q='.$Current_song.'&name=1", "mywindow","toolbar=1,menubar=1,resizable=1,Scrollbars=1,width=850,height=400");\'><img src="http://cdn1.iconfinder.com/data/icons/yooicons_set01_socialbookmarks/128/social_google_box.png" width="16" height="16" alt="???????°???? '.$Current_song.' ?? Google" /></a> ?? '; //$Current_song = iconv("cp1251", "utf-8", $Current_song); echo' <a href=\'\' onclick=\'javascript:window.open("http://spaces.ru/music/?sid=&p=&search=1&word='.$Current_song.'&name=1", "mywindow","toolbar=1,menubar=1,resizable=1,Scrollbars=1,width=850,height=400");\'><img src="http://cdn1.iconfinder.com/data/icons/yooicons_set01_socialbookmarks/128/social_google_box.png" width="16" height="16" alt="???????°????'; //$Current_song = iconv("utf-8", "cp1251", $Current_song); echo' '.$Current_song.' ???° Spaces" /></a> </font> </div></td> </tr> </table> '; ?>