diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2010-08-24 17:28:38 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2010-08-24 17:28:38 +0000 |
commit | 3423d866592c433b1f2f3984b9dc95d993cccea2 (patch) | |
tree | 2e4b59cac340db89e55d85f66d70505a09f666fe | |
parent | e7ca1a4415d0783a3fd42b625bb7e7aecd4fc7ee (diff) |
Ny opsjon -i for å liste IDen til filmene med tonoflagg.
-rwxr-xr-x | frikanalen/bin/frikanalen-tonostats | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/frikanalen/bin/frikanalen-tonostats b/frikanalen/bin/frikanalen-tonostats index 6c5c7b8..beff1d6 100755 --- a/frikanalen/bin/frikanalen-tonostats +++ b/frikanalen/bin/frikanalen-tonostats @@ -3,6 +3,7 @@ use strict; use warnings; use vars qw(%opts %orgs); +use Data::Dumper; use Getopt::Std; @@ -39,6 +40,10 @@ sub get_tono_stats { if ("true" eq $video->{'HasTonoRecords'}) { $tono++; $orgs{$video->{'Organization'}}{tono}++; + push(@{$orgs{$video->{'Organization'}}{tonoids}}, + $video->{MetaDataVideoId}); +# print Dumper($video); +# exit 0; } else { $notono++; $orgs{$video->{'Organization'}}{notono}++; @@ -49,12 +54,15 @@ sub get_tono_stats { sub print_tono_stats { my ($with, $without) = get_tono_stats(); printf("Innslag med tono-musikk: %d (%.1f%%)\n", $with, 100 * $with / ($with+$without)); - printf("Innslag uten tonon-musikk: %d (%.1f%%)\n",$without, 100 *$without/($with+$without)); + printf("Innslag uten tono-musikk: %d (%.1f%%)\n",$without, 100 *$without/($with+$without)); for my $org (sort tonoorder keys %orgs) { my $tono = $orgs{$org}{tono} || 0; my $notono = $orgs{$org}{notono} || 0; - print "$tono\t$notono\t$org\n"; + my $frac = int(100 * $tono / ($tono+$notono)); + print "$frac\t$tono\t$notono\t$org\n"; + print join(" ", " ", @{$orgs{$org}{tonoids}}), "\n" + if $opts{'i'} && exists $orgs{$org}{tonoids}; } } @@ -79,7 +87,7 @@ EOF } } -getopts("m", \%opts); +getopts("im", \%opts); if ($opts{'m'}) { munin_plugin(@ARGV); |