Friday, December 4, 2009: Monitoring Web Pages « from the old blog archive »

My friends wanted my help. There is a locked forum topic that will open for reply in the next 20 minutes. He needs to reply on that topic as soon as it is available.

I used this script.

#!/bin/bash
URL='the url you want to monitor'
MATCH='the text that if match, means that the topic is still locked'
while true; do
    if (curl "$URL" | grep "$MATCH"); then
        echo '!!!!!!!!!!!!!!!!~ Not Yet'
    else
        echo '!!%$$%!%$#@$%#$%@%$%$!#%$!%%^!%^@%^!%^@!! NOW!'
    fi
    sleep 60
done

So this bash script just periodically checks that page until the match is not found.

The reason why I need to make a bash script is because I forgot to install the ReloadEvery extension for Firefox.