Created
August 6, 2019 18:58
-
-
Save keyan/de841b4a2f59785f29227bfaabe12c49 to your computer and use it in GitHub Desktop.
bash script that curls a url every minute and outputs audio if a regex doesn't match
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
check_for_opening () { | |
res=`curl --silent "https://unionpt.fullslate.com/employees/4320?iid=7959&services%5B%5D=208" | grep "Next opening"` | |
if [ -n "`echo $res | grep -e '.*Thursday, September 5.*'`" ] | |
then | |
echo "No openings found, sleeping..." | |
else | |
say "Found an appointment opening" | |
fi | |
} | |
while true; do | |
check_for_opening | |
sleep 60 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment