all repos — checkwebpage @ master

This is a GNU/Linux-compatible script I made to check for changes in a webpage.

check.sh (view raw)

 1#!/bin/bash
 2#Before you run this script, make sure wget is installed and check https://github.com/mashlol/notify
 3
 4#ADD NOTIFY KEY HERE
 5NOTIFYKEY=insertNotifyKeyHere
 6
 7#EDIT LINK OF THE WEBPAGE TO CHECK
 8LINK=insertLinkHere
 9
10#YOU CAN EDIT THE INTERVAL, I SET IT TO 300s = 5 minutes
11INTERVAL=300
12
13#INSERT YOUR SUCCESS TEXT HERE, THIS WILL APPEAR IN YOUR NOTIFICATION
14SUCCESS="The webpage was edited!"
15
16
17notify -r $NOTIFYKEY
18wget -O temp $LINK --quiet
19SIZE1=$(stat -c%s "temp")
20rm temp
21SIZE2=$SIZE1
22I=0
23while [ "$SIZE1" -eq "$SIZE2" ]; do
24	sleep $INTERVAL
25	echo $I
26	wget -O temp $LINK --quiet
27	SIZE2=$(stat -c%s "temp")
28	rm temp
29	let I=I+1
30done
31
32notify -t "$SUCCESS"
33notify -u $NOTIFYKEY