Created
July 8, 2020 09:52
-
-
Save filipemp/ae0a5acea2cd5930900d8c0da8f2688c to your computer and use it in GitHub Desktop.
This file contains 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/bash | |
ROOT_URL="https://service.berlin.de/terminvereinbarung/termin" | |
FULL_URL="${ROOT_URL}/tag.php?termin=1&anliegen[]=120686&dienstleisterlist=122210,122217,122219,122227,122231,122243,122252,122260,122262,122254,122271,122273,122277,122291,122285,122286,122296,150230,122301,122297,122294,122312,122314,122304,122311,122309,122281,122279,122276,122274,122267,122246,122251,122257,122208,122226&herkunft=http%3A%2F%2Fservice.berlin.de%2Fdienstleistung%2F120686%2F" | |
DELAY_SEC=600 | |
PATTERN="\"buchbar\"" | |
function show_notification { | |
osascript -e 'display notification "Termin available for Anmeldung!"' | |
} | |
counter=1 | |
while true | |
do | |
echo "Run number: $counter" | |
slot_exists=`wget ${FULL_URL} -qO- | grep -c "${PATTERN}"` | |
[[ $slot_exists -gt 0 ]] && show_notification && echo "$(date): $slot_exists slots available now!" | |
((counter++)) | |
sleep ${DELAY_SEC} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment