Skip to content

Instantly share code, notes, and snippets.

@liclac
Created December 31, 2019 15:23
Show Gist options
  • Save liclac/44760b4275e47296819fb8cbb51cefcd to your computer and use it in GitHub Desktop.
Save liclac/44760b4275e47296819fb8cbb51cefcd to your computer and use it in GitHub Desktop.
set -l data_status (curl -s https://iceportal.de/api1/rs/status)
set -l data_trip (curl -s https://iceportal.de/api1/rs/tripInfo/trip)
# next stop
echo  (echo $data_trip | jq -r '([ .trip.stops[] | select(.info.passed==false) ]
| first).station.name')
# train number
echo  (echo $data_trip | jq -r '"\(.trip.trainType)-\(.trip.vzn)"')
# speed
echo speed (echo $data_status | jq -r '"\(.speed) km/h"')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment