Skip to content

Instantly share code, notes, and snippets.

@keyan
Created August 6, 2019 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keyan/de841b4a2f59785f29227bfaabe12c49 to your computer and use it in GitHub Desktop.
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
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