+# alert on changes to a webpage (just the base page that curl gets)
+# usage: weblert URL [SUBJECT...]
+weblert() {
+ local u old new quiet
+ quiet=false
+ case $1 in
+ # dont send a diff of the html. some html is not very readable
+ -q) quiet=true
+ shift
+ ;;
+ esac
+ u="$1"
+ shift
+ subject="${*:-weblert}"
+ old=$(curl -s "$u") ||:
+ while true; do
+ new=$(curl -s "$u") ||:
+ if [[ $old && $new ]]; then
+ if [[ $new != "$old" ]]; then
+ if $quiet; then
+ echo | daylertme "$subject"
+ else
+ diff <(printf "%s\n" "$old") <(printf "%s\n" "$new") | daylertme "$subject" ||:
+ fi
+ fi
+ old="$new"
+ fi
+ sleep $(( 60 + RANDOM % 120 ))
+ done
+}
+
+torshell() {
+ # per man torsocks
+ source `type -p torsocks` on
+}
+
+eless2() {
+ less /var/log/exim4/mymain
+}
+