Skip to content

Instantly share code, notes, and snippets.

@jonahbron
Created August 23, 2016 19:06
Show Gist options
  • Save jonahbron/71644aa1a13b035ac9446bb9a6678a08 to your computer and use it in GitHub Desktop.
Save jonahbron/71644aa1a13b035ac9446bb9a6678a08 to your computer and use it in GitHub Desktop.
#!/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