Skip to content

Instantly share code, notes, and snippets.

@coffebar
Created January 19, 2019 09:30
Show Gist options
  • Save coffebar/503cd60e644af69f4bea9917e48e09b8 to your computer and use it in GitHub Desktop.
Save coffebar/503cd60e644af69f4bea9917e48e09b8 to your computer and use it in GitHub Desktop.
Watch for regexp result changes on the web page
#!/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