browser: count unknown agent versions as old
[sheet.git] / tools / mkusage-wikimedia
index 5e264ed295ed0bba44b22ddd616a1a6d304a68f6..6ce3652498ce6111ae1c659ac0ffa5a1777db1d7 100755 (executable)
@@ -9,8 +9,8 @@ our $VERSION = '1.00';
 my %BROWSERID = qw(
        IE                      ie
        IE-Mobile               ie_mob
-       Edge                    edge
-       Edge-Mobile             edge
+       Edge                    ie
+       Edge-Mobile             ie
        Firefox                 firefox
        Firefox-Mobile          and_ff
        Safari                  safari
@@ -18,8 +18,8 @@ my %BROWSERID = qw(
        Mobile-Safari-UIWebView ios_saf
        Chrome                  chrome
        Chromium                chrome
-       Chrome-Mobile           and_chr
-       Chrome-Mobile-iOS       and_chr
+       Chrome-Mobile           android
+       Chrome-Mobile-iOS       android
        Android                 android
        Opera                   opera
        Opera-Mini              op_mini
@@ -41,6 +41,7 @@ while (my $row = readline) {
        $date =~ $recent or next;
        $name =~ y/ /-/;
        my $browser = $BROWSERID{$name} or next;
+       $version =~ s/\A-\z/0/;
        $count{$browser}{$version} += $pct;
        $count{-total} += $pct;
        $count{-date}->{$date}++;