browser: makefile rule for wikimedia usage include
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 29 Apr 2017 23:19:36 +0000 (01:19 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 29 May 2017 17:22:49 +0000 (19:22 +0200)
Makefile
tools/mkusage-wikimedia

index 804bba7..7eea34b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
-all: digraphs.inc.pl unicode-cover.inc.pl countries.inc.pl data/browser/support.inc.pl termcol-xcolor.inc.pl
+all: digraphs.inc.pl unicode-cover.inc.pl countries.inc.pl data/browser termcol-xcolor.inc.pl
 more: all data/digraphs-xorg.inc.pl
 
-download: data/DerivedAge.txt data/rfc1345.txt data/xorg-compose data/countryInfo.txt data/browser/caniuse
+download: data/DerivedAge.txt data/rfc1345.txt data/xorg-compose data/countryInfo.txt data/browser/caniuse data/browser/usage-wm.tsv
 .PHONY: download
 
 data/DerivedAge.txt:
@@ -82,6 +82,8 @@ data/countryInfo.txt:
 countries.inc.pl: tools/mkcountries-geonames data/countryInfo.txt
        $< $(word 2,$^) >$@
 
+data/browser: data/browser/support.inc.pl data/browser/usage-wm.inc.pl
+
 data/browser/caniuse/data.json: data/browser/caniuse
 data/browser/caniuse:
        [ -r $@/.git ] && cd $@ && git pull --ff-only
@@ -90,6 +92,12 @@ data/browser/caniuse:
 data/browser/support.inc.pl: tools/mkcaniuse data/browser/caniuse/data.json
        $< $(word 2,$^) >$@
 
+data/browser/usage-wm.tsv:
+       tools/wget-ifmodified https://analytics.wikimedia.org/datasets/periodic/reports/metrics/browser/all_sites_by_browser_family_and_major_percent.tsv $@
+
+data/browser/usage-wm.inc.pl: tools/mkusage-wikimedia data/browser/usage-wm.tsv
+       $< $(word 2,$^) >$@
+
 clean:
        -rm digraphs.inc.pl
        -rm unicode-char.inc.pl
@@ -97,6 +105,7 @@ clean:
        -rm -rf ttfsupport/
        -rm unicode-cover.inc.pl
        -rm data/browser/support.inc.pl
+       -rm data/browser/usage-wm.inc.pl
 
 .SECONDEXPANSION:
 
index a50d899..21ba753 100755 (executable)
@@ -59,6 +59,5 @@ __END__
 
 =head1 USAGE
 
-       curl https://analytics.wikimedia.org/datasets/periodic/reports/metrics/browser/all_sites_by_browser_family_and_major_percent.tsv |
-       ./mkusage-wikimedia >browser-usage.inc.pl
+       ./mkusage-wikimedia wikipedia-analytics.tsv >browser-usage.inc.pl