Hi,

I have used the following script to get the stats from icecast's report:

#!/usr/bin/ruby

require 'hpricot'
require 'open-uri'

# Base URL to the icecast server, don't forget the trailing slash
ice_host = "http://localhost:8000/admin/listclients.xsl?mount=";
user = "xxx"
pass = "xxx"
mounts = [ "MOUNT.mp3", "MOUNT.ogg" ]

# Number of icecast listeners
mounts.each { |m|
  puts "#{m}:"
  doc = Hpricot(open("#{ice_host}/#{m}",
                     :http_basic_authentication=>[user,pass]))
  doc.search('//td').each { |c|
    txt = c.inner_html
    if /^[0-9]+.[0-9]+.[0-9]+.[0-9]+$/.match(txt) then
      puts "  #{txt}"
    end
  }
}

You can call it in various ways depending on what you need. I was
actually calling another script using on_track, and that other script
was calling this one among other things to generate a status.xml file
which was loaded on our website using ajax.

HTH

David

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to