Skip to content

Instantly share code, notes, and snippets.

@2001db8
Forked from liclac/de_ice.fish
Created December 31, 2019 15:51
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 2001db8/162c15f367bfd22c97366d44a1231a8a to your computer and use it in GitHub Desktop.
Save 2001db8/162c15f367bfd22c97366d44a1231a8a 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