rozklad-mpk/schedule

12 lines
448 B
Plaintext
Raw Permalink Normal View History

2019-04-13 22:37:33 +02:00
#!/bin/bash
peka_vm_get()
{
curl -H 'Content-Type:application/x-www-form-urlencoded; charset=UTF-8' \
http://www.peka.poznan.pl/vm/method.vm \
-d "method=$1" \
-d "p0=$2" \
-s
}
peka_vm_get getTimes '{"symbol":"'$1'"}' | jq -r '.[] | [.times] | .[] | .[] | [.minutes,.line,.direction] | @csv' | awk -v FS="," 'BEGIN{print "Min\tLine\tDirection\t";print "==================================="}{printf "%s\t%s\t%s%s",$1,$2,$3,ORS}'