-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |