Skip to content

Instantly share code, notes, and snippets.

@dewomser
Last active July 12, 2025 05:08
Show Gist options
  • Save dewomser/fcf6e24737e6e6a0df1a5982b7c19de7 to your computer and use it in GitHub Desktop.
Save dewomser/fcf6e24737e6e6a0df1a5982b7c19de7 to your computer and use it in GitHub Desktop.
Das Script lässt sich auf andere Bahnhöfe anpassen. Stadtnamen ändern. und die Nummer hinter Hbf Die Nummer steht im Quelltext der Webseite inputRef
#Funktioniert nicht mehr /Neue URL https://www.bahnhof.de/worms-hbf
#!/bin/bash
worms="https://reiseauskunft.bahn.de/bin/bhftafel.exe/dn?ld=4011&protocol=https:&rt=1&evaId=8000257&boardType=dep&productsFilter=11111&rtMode=&start=yes"
Ansage=$(curl -s -X GET $worms | html2text | grep Grund -C1)
curl -s -X GET $worms|grep '<class=\"red bold\">' -m1
if [ -z "${Ansage}" ]; then
echo "Es gibt keine Störung im Bahnhof"
espeak -vde "Esgibtkeine Störung im bahnhof"
fi
echo $Ansage | espeak -vde
echo $Ansage
#Funktioniert nicht mehr /Neue URL https://www.bahnhof.de/worms-hbf
clear; echo -e "\nVerspätungen im Bahnhof Worms\n" ; worms="https://reiseauskunft.bahn.de/bin/bhftafel.exe/dn?ld=4011&protocol=https:&rt=1&evaId=8000257&boardType=dep&productsFilter=11111&rtMode=&start=yes";curl -s -X GET $worms|grep -E "*" 2>&1 | html2text --ignore-links --ignore-images | grep -E -B 4 "Grund"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment