Last active
March 1, 2018 13:21
-
-
Save cympfh/87ff6ebc8dccf3b27e2d6969be305ef4 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
DAT=/tmp/kintai.jsonl | |
DAT1=/tmp/kintai.jsonl.1 | |
DAT2=/tmp/kintai.jsonl.2 | |
PNG=/tmp/kintai.png | |
curl -s "http://s.cympfh.cc/cympfh/kintai" | cut -d ' ' -f2 > $DAT | |
grep shussha $DAT | jq -r .datetime > $DAT1 | |
grep taisha $DAT | jq -r .datetime > $DAT2 | |
OPTS="w lp lw 2 pt 6" | |
gnuplot <<EOM | |
set terminal pngcairo | |
set output '${PNG}' | |
set xdata time | |
set ydata time | |
set format x '%m/%d' | |
set format y '%H:%M' | |
set grid | |
set yrange [*:*] reverse | |
plot '$DAT1' u (timecolumn(1, '%Y-%m-%d')):(timecolumn(2, '%H:%M:%S')) $OPTS title 'shussha', \ | |
'$DAT2' u (timecolumn(1, '%Y-%m-%d')):(timecolumn(2, '%H:%M:%S')) $OPTS title 'taisha' | |
EOM | |
rm $DAT $DAT1 $DAT2 | |
echo ${PNG} | |
open ${PNG} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment