Created
August 23, 2016 19:06
-
-
Save jonahbron/71644aa1a13b035ac9446bb9a6678a08 to your computer and use it in GitHub Desktop.
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 | |
URL="page to watch" | |
PATTERN="pattern in page to watch" | |
get_page() { | |
curl "$URL" 2> /dev/null | grep -C 3 "$PATTERN" | |
} | |
NEW=$(get_page) | |
OLD=$NEW | |
while [ "$OLD" == "$NEW" ]; do | |
OLD=$NEW | |
NEW=$(get_page) | |
sleep 10 | |
done | |
while true; do | |
spd-say "Page changed" | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment