Net::Icecast - Object oriented functions to run your icecast server by bash operations.
require Net::Icecast;
WARNING!!! This module can only be use if your icecast server is older than version 1.3.7
The commands you're used to find in an icecast server are in this module (Not all but only the ones i needed!). They can permit you to create programs that configure your icecast server by bash operations. If you find that there are importants functions that need to be add, you can modify it under the same terms as Perl itself! (If you want more details about the functions see the icecast commands documentation)
So good fun...
(be careful with the orthography of the objects, the orthography is the same that the icecast's commands)
Returns a hash table of alls connected sources / listeners $my_session->sources() $my_session->listeners()
Differents methods $my_session->set() $my_session->modify() $my_session->allow() you can't do "allow ... list" $my_session->deny() you can't do "deny ... list" $my_session->kick() $my_session->selection() $my_session->alias() $my_session->dir() $my_session->touch() $my_session->status() $my_session->debug()
First of all you have to run your icecast server, run a source encoder, and a client (to do this take a look at the doc). Then execute this code in a perl programm:
#Programme gives you informations about the clients and sources in your icecast server
#!/usr/bin/perl
require Icecast;
my $session = Net::Icecast->new("icecast.computer.host",$port?,"ADMIN_Password");
$session->set_oper("OPER_Password");
my %sources = $session->sources;
print "Sources:\n";
foreach $key (keys %sources) { #To print the IP address, ... print "Id : $key, host : $sources{$key}->{host}\n"; }
my %clients = $session->listeners; print "Clients:\n";
foreach $key (keys %clients) { #To print the source id, the mount point... print "Id : $key, host : $clients{$key}->{host}\n"; }
#And if you want to change the admin_password #$session->set("admin_password my_new_password");
#or client_password: #$session->set("client_password secret_password");
#And you can test other functions with the same way #that you test this one!
#Isn't it very simple to use it :)
Andrès Marino
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Andrès'. Assuming CP1252
To install Net::Icecast::IceObject, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Icecast::IceObject
CPAN shell
perl -MCPAN -e shell install Net::Icecast::IceObject
For more information on module installation, please visit the detailed CPAN module installation guide.