rozklad-mpk/rozklad
Marcin Wozniak ad97745580 Version 1.0
2019-04-13 22:37:33 +02:00

12 lines
448 B
Bash
Executable File

#!/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}'