Skip to content

Commit

Permalink
[utils] DS stats generation script
Browse files Browse the repository at this point in the history
  • Loading branch information
bamthomas committed Feb 13, 2019
1 parent 391a8c3 commit 00d2159
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions stats.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

curl https://api.github.com/repos/ICIJ/datashare-installer/releases | jq -r '.[]|[.tag_name, .assets[].download_count] | @csv' > /tmp/ds_stats.csv
sed -i '1i release,mac,windows,linux' /tmp/ds_stats.csv

function create_plot_file {
cat > /tmp/ds_stats.plot << EOF
set grid
set xtics rotate by -45
set datafile separator ","
set term png enhanced size 1024,800
set output "ds_stats.png"
set style data histogram
set style histogram rowstacked
set style fill solid border rgb "black"
set auto x
set yrange [0:*]
set xlabel "releases"
set ylabel "nb downloads"
set title "Datashare downloads"
plot '/tmp/ds_stats.csv' using 3:xtic(1) title col, \
'' using 2:xtic(1) title col, \
'' using 4:xtic(1) title col
EOF
}

create_plot_file
gnuplot /tmp/ds_stats.plot

0 comments on commit 00d2159

Please sign in to comment.