3 # Copyright (c) 2002 Ivan Kohler
5 # This program is free software; you can redistribute it and/or modify it under
6 # the same terms as Perl itself.
14 require "/etc/icesnap.conf";
16 unless ( -e $outdir) {
17 mkdir($outdir, 0755) or die "can't mkdir $outdir: $!";
20 my $c = Net::Icecast->new($host, $port, $admin_password)
21 or die "can't connect";
23 my %hash = $c->listeners;
26 use vars qw( %mount );
29 foreach my $mount (qw( / /24 ) ) {
33 foreach my $listener ( keys %hash ) {
34 # print "$listener => \n";
35 my %lhash = %{$hash{$listener}};
36 foreach my $key ( keys %lhash ) {
37 # print " $key => $lhash{$key}\n";
40 $mount{$lhash{mountpoint}}{$lhash{user_agent}}++;
46 foreach $mount ( keys %mount ) {
49 # print "$mount => \n";
50 # foreach my $user_agent ( keys %{$mount{$mount}} ) {
51 # $total += $mount{$mount}{$user_agent};
52 # print " $user_agent => $mount{$mount}{$user_agent}\n";
54 # print " TOTAL $total\n\n";
59 # my %mount = %{shift()};
62 open(STDOUT,">$outdir/$mount.html") or die "can't open $outdir/$mount.html: $!";
64 #nicked from cgi/asp in the Apache::ASP disribution
66 my $r = &Apache::ASP::CGI::init($template);
68 $r->dir_config('NoHeaders', 1);
70 &Apache::ASP::handler($r);