Skip to content

Instantly share code, notes, and snippets.

@alexeckermann
Last active May 22, 2019 09:07
Show Gist options
  • Save alexeckermann/66d605e82da781fa8c036d1414bfe9b9 to your computer and use it in GitHub Desktop.
Save alexeckermann/66d605e82da781fa8c036d1414bfe9b9 to your computer and use it in GitHub Desktop.
Australian Tesla Model 3 ordering watch
#!/bin/bash
# Execute this script to be notified when the Tesla Model 3 order page is available to Australia.
while true
do
echo -n `date`
STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" https://www.tesla.com/en_AU/model3/design)
if [[ $STATUS_CODE > "199" && $STATUS_CODE < "300" ]]
then
echo -e " \033[42;1m AVAILABLE! \033[0m"
say -v Karen -r 250 "Tesla Model 3 is available! Tesla Model 3 is available!"
exit 0
fi
echo -e " \033[41;1m NOT AVAILABLE \033[0m ${STATUS_CODE}"
# Checks only every 10 minutes
sleep 600
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment