Created
June 4, 2019 10:05
-
-
Save dNitza/a2293ebf1edf01ab43b0b1e59504440d to your computer and use it in GitHub Desktop.
Detect if WWDC19 Platforms State of the Union is available
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 | |
# Thanks to https://gist.github.com/alexeckermann/3f6a051e876e4c03e3b6341b7b05a7ad | |
# Execute this script to be notified when the WWDC 2019 Platforms State of the Union is available. | |
# Make sure this file is `chmod +x` to run in your Terminal. | |
while true | |
do | |
echo -n `date` | |
# Assumption is that the video page will contain an m3u8 file when the video is available. | |
KEYWORD_COUNT=$(curl -s https://developer.apple.com/videos/play/wwdc2019/103/ | grep -c "m3u8") | |
if [[ $KEYWORD_COUNT > "0" ]] | |
then | |
echo -e " \033[42;1m AVAILABLE! \033[0m" | |
say -v Karen -r 250 "State of the union is available!" | |
exit 0 | |
fi | |
echo -e " \033[41;1m NOT AVAILABLE \033[0m ${KEYWORD_COUNT}" | |
# Checks only every 2 minutes | |
sleep 120 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment