From 20dbc2d584ced2a61eaab1f0f5caf75373e79f5b Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Tue, 13 Sep 2011 13:17:34 -0400 Subject: [PATCH] Count all audio files together. --- oggcast-count.plx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/oggcast-count.plx b/oggcast-count.plx index 3ee33e9..4e23749 100755 --- a/oggcast-count.plx +++ b/oggcast-count.plx @@ -27,6 +27,9 @@ while (<>) { my($ip, $method, $url) = ($1, $2, $3); next unless $method =~ /^\s*GET\s*$/i; + $url =~ s/\s*\.(ogg|mp3)\s*$/.audio/i; # Treat ogg and mp3 downloads same. + $url =~ s/\s*\/$$//; # Always remove trailing slash + $data{$url}{$ip} = 0 unless defined $data{$url}{$ip}; $data{$url}{__TOTAL__} = 0 unless defined $data{$url}{__TOTAL__}; $data{$url}{$ip}++;