Skip to content

Instantly share code, notes, and snippets.

@cympfh
Last active March 1, 2018 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cympfh/87ff6ebc8dccf3b27e2d6969be305ef4 to your computer and use it in GitHub Desktop.
Save cympfh/87ff6ebc8dccf3b27e2d6969be305ef4 to your computer and use it in GitHub Desktop.
#!/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