browser: only annotate end date of wikimedia data
[sheet.git] / tools / mkusage-wikimedia
index 5e264ed295ed0bba44b22ddd616a1a6d304a68f6..a50d89942069ce8124dd74ab17fd839b1c090f3f 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,13 +41,12 @@ 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}++;
+       $count{-date} = $date;
 }
 
-$_ = join ' to ', (sort keys %{$_})[0, -1] for $count{-date};
-
 my $mult = 100 / delete $count{-total};
 for (values %count) {
        ref $_ eq 'HASH' or next;