Skip to content

Instantly share code, notes, and snippets.

@mayjs
Last active September 19, 2017 18:49
Show Gist options
  • Save mayjs/8723dcb9bcc399b2fae53624e14ac5f2 to your computer and use it in GitHub Desktop.
Save mayjs/8723dcb9bcc399b2fae53624e14ac5f2 to your computer and use it in GitHub Desktop.
#!/bin/bash
bottoken=<INSERT TOKEN>
chatid=<INSERT CHAT>
matrikel=<INSERT MATRIKEL>
# USE curl https://api.telegram.org/bot$bottoken/getUpdates to get the chatID!
telegrambase=https://api.telegram.org/bot$bottoken/sendMessage?chat_id=$chatid
if [[ $(curl -vs -F "matrikel=$matrikel" http://dekanat.cs.uni-dortmund.de/web/de/cgi-bin/zqueryBA.cgi 2>&1 | grep Zeugnis_Nicht_Vorhanden) ]]; then
echo Kein Zeugnis!
curl -s "$telegrambase"\&text="Kein Zeugnis!"\&disable_notification=true
else
echo Zeugnis ist da!
curl -s "$telegrambase"\&text="Zeugnis ist da!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment