PHP Classes

Using the class

Recommend this page to a friend!

      Icecast Info  >  All threads  >  Using the class  >  (Un) Subscribe thread alerts  
Subject:Using the class
Summary:Can you help me with an example to use this class
Author:Jorge Orlando Huaraca Aguay
Date:2008-09-17 01:15:27
Update:2011-09-30 10:20:26


  1. Using the class   Reply   Report abuse  
Picture of Jorge Orlando Huaraca Aguay Jorge Orlando Huaraca Aguay - 2008-09-17 01:15:27
Hi, i am Orlando. Please , can you help me with an example of using this class.



  2. Re: Using the class   Reply   Report abuse  
Picture of Adam Fitch Adam Fitch - 2009-01-18 21:02:26 - In reply to message 1 from Jorge Orlando Huaraca Aguay
$a = new parse_icecast_info();
$response = $a->iceinfo("YourIPGoesHere","portGoesHere","adminLogin","adminPass");

echo "<pre>";
echo "</pre>";

I got a warning regarding line #17 in the class, I just commented that line out myself and quickly got this class to work for me. It doesn't show current song info, which is lame, but it does show number of current listeners, and stats about the quality of the stream.

  3. Re: Using the class   Reply   Report abuse  
Picture of WebCommander WebCommander - 2011-09-30 10:20:27 - In reply to message 2 from Adam Fitch
This is this two years old, but in case someone else finds it; you can edit the script to display whatever you want from the icecast xml file you are parsing, in the given example array.

Here is a modified section of the class that shows the "TITLE" which should include Artist and Song title (added lines below marked with "*". Do not include when modding your class):

if ($this->objcomp == "AUDIO_INFO")
$this->temp == "audio_info";
elseif ($this->objcomp == "BITRATE")
elseif ($this->objcomp == "CHANNELS")
*elseif ($this->objcomp == "TITLE")
* $this->temp->Title=$dato;
elseif ($this->objcomp == "LISTENERS")
elseif ($this->objcomp == "LISTENURL")
elseif ($this->objcomp == "PUBLIC")
elseif ($this->objcomp == "SAMPLERATE")

Hope this helps someone!

For more information send a message to info at phpclasses dot org.