deaddred Posted November 26, 2014 Share Posted November 26, 2014 (edited) Not sure how efficient this script is but atm while I'm still gathering software for my station I got these two scripts to work together to display the listener count and current track and refresh the info automatically every 5 or so seconds. The php script. Put this into stream.php file $icecast_url='http://stream_url.com:8000'; $output = file_get_contents($icecast_url); $search='#.*?Point /(.*?)M3U(.*?)(.*?)#si'; preg_match_all($search, $output, $matches); $j=count($matches[0]); for ($i=0;$i$point_name=$matches[1][$i]; $pount_m3u=$icecast_url.$matches[2][$i]; $point_listners_count=$matches[3][$i]; $point_current_song=$matches[4][$i]; // echo 'Listeners: '.$point_listners_count.' '; echo 'Playing: '. $point_current_song.''; } ?> The AJAX script I got here http://www.brightcherry.co.uk/scribbles/jquery-auto-refresh-div-every-x-seconds/ <br /> $(document).ready(function() {<br /> $("#responsecontainer").load("stream.php");<br /> var refreshId = setInterval(function() {<br /> $("#responsecontainer").load('stream.php?randval='+ Math.random());<br /> }, 9000);<br /> $.ajaxSetup({ cache: false });<br /> });<br /> Edited November 26, 2014 by deaddred more info 1 Link to comment Share on other sites More sharing options...
deaddred Posted November 26, 2014 Author Share Posted November 26, 2014 You can see it working here http://futureassassin.com/ Link to comment Share on other sites More sharing options...
jarred89 Posted January 26, 2015 Share Posted January 26, 2015 Hello, I am wanting an icecast Now Playing script on my website. I am stuck on how to install this one onto my website. Can you please explain it. It keeps coming up with an error on line 3. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now