X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/24d8e7421e79afd514ce6b9035783e4231dabc84..4e71d82512759ed7da92d213ac66d006dae456a1:/tools/convert-stats-wikimedia.pl diff --git a/tools/convert-stats-wikimedia.pl b/tools/convert-stats-wikimedia.pl old mode 100644 new mode 100755 index d65e5eb..1e9b1c3 --- a/tools/convert-stats-wikimedia.pl +++ b/tools/convert-stats-wikimedia.pl @@ -1,10 +1,19 @@ -#!perl -n +#!/usr/bin/perl -n use 5.010; use strict; use warnings; our %count; +our $mobile; + +if (m{} .. m{}) { + $count{-source} = 'http://stats.wikimedia.org/archive/squid_reports/'; + $count{-title } = 'Wikimedia'; + $count{-date} = $1 if m{ period: (?:\d+ )?(\w+ \d+) }; + next; +} # select relevant columns -/>Browser versions/ ... m{} && last or next; +/>Browser versions(.*)/ ... m{} && last or next; my ($tr, $id, $count2, $count) = split /(?:<[^>]*>)+/; +$mobile = $count2 =~ /(? '2' ], - [ '522' => '3' ], - [ '525.013' => '3.1' ], - [ '525.026' => '3.2' ], - [ '526' => '4' ], - [ '533' => '5' ], - [ '534' => '5x' ], + $mobile ? ( + [ '413' => '1' ], + [ '419' => '1.1' ], + [ '525' => '2' ], + [ '528' => '3' ], + [ '531' => '3.2' ], + [ '531.022' => '4' ], + [ '533' => '4.2' ], + [ '534' => '4x' ], + ) : ( + [ '413' => '2' ], + [ '522' => '3' ], + [ '525.013' => '3.1' ], + [ '525.026' => '3.2' ], + [ '526' => '4' ], + [ '533' => '5' ], + [ '534' => '5x' ], + ) ) { last if $numversion lt $_->[0]; $version = $_->[1]; } } when ('Chrome') { - $browser = 'webkit_chr'; + $browser = 'chrome'; s/\.\d+$// for $version; } + when ('Android') { + $browser = 'android'; + } s/\.0$// for $version; }