Created
January 19, 2019 09:30
-
-
Save coffebar/503cd60e644af69f4bea9917e48e09b8 to your computer and use it in GitHub Desktop.
Watch for regexp result changes on the web page
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
#!/usr/bin/env bash | |
function send_telegram { | |
echo "$1" | |
} | |
ver1path="$0.1.cache" | |
ver2path="$0.2.cache" | |
ver1=$(cat $ver1path) | |
curl --silent "https://9gag.com/gag/a2Z7Vpw" 2>&1 | grep 'fbq(' > "$ver2path" | |
ver2=$(cat $ver2path) | |
if [ "$ver1" != "$ver2" ];then | |
send_telegram "$ver2" | |
echo "$ver2" > $ver1path | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment