Skip to content

Instantly share code, notes, and snippets.

@karolyi
Last active December 16, 2019 12:48
Show Gist options
  • Save karolyi/7e7369ad67a3c2f14c6b to your computer and use it in GitHub Desktop.
Save karolyi/7e7369ad67a3c2f14c6b to your computer and use it in GitHub Desktop.
Best appointment date finder for the Berlin authorities
#!/usr/bin/env bash
RETCODE=1
# Change the URL in the curl commandline for yourself.
while [[ $RETCODE == 1 ]]; do
echo -n "$RANDOM ... "
OUT=$(curl -gs "https://service.berlin.de/terminvereinbarung/termin/tag.php?termin=1&anliegen[]=121598&dienstleisterlist=122210,122217,122219,122227,122231,122238,122243,122252,122260,122262,122254,122271,122273,122277,122280,122282,122284,122285,122286,122296,150230,122301,122297,122294,122312,122314,122304,122311,122309,317869,324433,325341,324434,122281,122276,122274,122267,122246,122251,122257,122208,122226,121646&herkunft=http%3A%2F%2Fservice.berlin.de%2Fdienstleistung%2F121598%2F&asd=$RANDOM"|grep '"buchbar'|head -1|grep 'datum=2015-10')
RETCODE=$?
if [[ $RETCODE == 1 ]]; then
echo no, waiting 1 sec
sleep 1
fi
done
echo YES
echo -e "\a"
PARSED=$(echo $OUT|awk -F '"' '{ print $6 }'|sed 's/\&/\&/g')
URL="http://service.berlin.de/terminvereinbarung/termin/$PARSED"
open $URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment