Skip to content

Instantly share code, notes, and snippets.

@dewomser
Last active November 24, 2022 19:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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
#!/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
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"
@dewomser
Copy link
Author

  1. stoerung.sh Komfortscript mir Sprachausgabe
  2. Verspätung… Bash Einzeiler

@dewomser
Copy link
Author

Weil die Bahn die Webseite geändert hat … hab ich den 1-Liner auch geändert. Störungen im Bahnhof Worms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment