Created
February 17, 2017 19:11
-
-
Save niltonvasques/d89a0d79a0dbbcee8befbfbd46b8097b to your computer and use it in GitHub Desktop.
Detect page changes and emit a high beep
This file contains hidden or 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
| # lynx --dump URL > old.html && watch -n 10 "./detect_page_change.sh" | |
| # | |
| #!/bin/bash | |
| RESULT=`diff old.html <(lynx --dump URL)` | |
| if [ "x`printf '%s' "$RESULT" | tr -d "$IFS"`" = x ]; then | |
| echo "NOTHING NEW" | |
| else | |
| ( speaker-test -t sine -f 1000 )& pid=$! ; sleep 3.1s ; kill -9 $pid | |
| echo "NEWS" | |
| echo $RESULT | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment