Created
October 25, 2023 09:15
-
-
Save bjesus/80b7839c83d0f5f9a339cf7a343ee1d5 to your computer and use it in GitHub Desktop.
GVB station departures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo '[5,"/stops/09900"]' | websocat wss://maps-wss.gvb.nl/ -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0' | tail -n +2 | while read -r line; do printf '%s\n' "$line" | jq -r '.[2]' | jq -r '.trip.lastCallMade.plannedDepartureAt + " " + .journey.publicLineNumber + " " + .journey.destination + " (" + .trip.lastCallMade.status + ", " + (.trip.lastCallMade.delay|tostring) + " delay)"'; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need
websocat
andjq
for this to work. Get your station number from https://reisinfo.gvb.nl/ - check the URL after clicking your station on the map. Use the station number instead of09900
in the script.