X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/7c8362694ebd579891ee698bd069ba2ce702b89a..0c4ca53d0803c3d9db0a06b57f650e65c3327467:/browser.plp diff --git a/browser.plp b/browser.plp index ce56bdb..e4e0b28 100644 --- a/browser.plp +++ b/browser.plp @@ -17,58 +17,67 @@ Html({
Alternate view of Fyrd's when can I use... page -with Wikimedia -browser usage statistics.
+<: +my $canihas = do 'browser-usage.inc.pl' + or printf "Browser usage data not found: %s.
\n", $! || $@; + +print "with $_ browser usage statistics." for map { + my $ref = $_->{-source} || 'unknown'; + $ref = sprintf '%s', $_, $ref for $_->{-url} || (); + $ref .= " $_" for $_->{-date} || (); + $ref +} $canihas || (); +:> +Browser usage data not found: %s.
\n", $_ - for $! || $@; - +{ - map { - $_ => +{ - map { - ($_->[4] => 0 ), # future - ($_->[3] => .5), # next - ($_->[0] => 5 ), # past - ($_->[1] => 10 ), # previous - ($_->[2] => 30 ), # current - } $caniuse->{agents}->{$_}->{versions} - } - } @browsers - }; # fallback hash based on release semantics -}; -my $scorediv = (max(map { sum(values %$_) } values %$canihas) // 1) / 100; +$canihas ||= { + map { + $_ => +{ + map { + my $zero = $#$_ - 2; # baseline index + ($_->[$zero - 2] => .5), # past + ($_->[$zero - 1] => 10 ), # previous + ($_->[$zero + 2] => 0 ), # future + ($_->[$zero + 1] => .5), # next + ($_->[$zero ] => 30 ), # current + } $caniuse->{agents}->{$_}->{versions} + } + } @browsers +}; # fallback hash based on release semantics +my $scorediv = (max(map { ref $_ eq 'HASH' && sum(values %$_) } values %$canihas) // 1) / 100; print 'supported - | prefixed - | partial + | supported + | prefixed + | partial | external (js/plugin) - | missing - | unknown + | missing + | unknown |