From d9eff44e9bb3e985cc7c39077b2a71eceabbfaec Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Tue, 13 Sep 2011 12:05:54 -0400 Subject: [PATCH] Handled things other than GET; fixed error output. --- oggcast-count.plx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 oggcast-count.plx diff --git a/oggcast-count.plx b/oggcast-count.plx old mode 100644 new mode 100755 index 8ab5b31..5ce229c --- a/oggcast-count.plx +++ b/oggcast-count.plx @@ -22,9 +22,9 @@ my %data; while (<>) { chomp; - die "invalid line: $!" unless - /^(\S+)\s+[^"]+"GET\s+(\S+)[\s"]/; - my($ip, $url) = ($1, $2); + die "invalid line: $_" unless /^(\S+)\s+[^"]+"\s*(HEAD|GET|POST)\s+(\S+)[\s"]/; + my($ip, $method, $url) = ($1, $2, $3); + next unless $method =~ /^\s*GET\s*$/i; $data{$url}{$ip} = 0 unless defined $data{$url}{$ip}; $data{$url}{__TOTAL__} = 0 unless defined $data{$url}{__TOTAL__};