Web page check script- need a little help

Web page check script- need a little help

Post by Warren Bel » Fri, 16 Jul 1999 04:00:00



I'm trying to make a script that will check a webpage based on it's size
and tell me it's been updated by executing an xterm with a message like
"Page Updated".  If it could check based on a Last updated stamp that
might even be better to save some download time with wget.

And if possible, could that xterm that was poped up be closed
automatically after 2 or so seconds and have the script carry on
checking for updates?

This script checks then mails the person a message.  How could I get it
to pop up an xterm instead?

script
-------------------------------------

#!/bin/sh
# Web page checking script to see when updated

# check page 1
wget -q http://page.org/index.html >ref.$$
    while sleep 1800; do
        wget -q http://page.org/index.html >tmp.$$
        cmp ref.$$ tmp.$$ >/dev/null ||
        diff -u ref.$$ tmp.$$ | mailx -s "Page updated"

        mv tmp.$$ ref.$$
    done

---------------------------------------

Thanks,
Warren Bell

Remove ERASE to reply

 
 
 

Web page check script- need a little help

Post by Ken Pizzi » Sat, 17 Jul 1999 04:00:00



>I'm trying to make a script that will check a webpage based on it's size
>and tell me it's been updated by executing an xterm with a message like
>"Page Updated".  If it could check based on a Last updated stamp that
>might even be better to save some download time with wget.

>And if possible, could that xterm that was poped up be closed
>automatically after 2 or so seconds and have the script carry on
>checking for updates?

>This script checks then mails the person a message.  How could I get it
>to pop up an xterm instead?

[snippage of a very familiar looking script containing:]

>        cmp ref.$$ tmp.$$ >/dev/null ||


  cmp ref.$$ tmp.$$ >/dev/null ||
  ( xterm -e sh -c 'echo Page Updated; exec sleep 2' & )

Though I find an xterm for that message to be a bit much.  Perhaps
an "xmessage" would be acceptable?
  cmp ref.$$ tmp.$$ >/dev/null ||
  (xmessage -timeout 2 'Page Updated' &)

Or perhaps you'd like to keep the e-mail *plus* have this message pop up:
  if cmp ref.$$ tmp.$$ >/dev/null; then
     (xmessage -timeout 2 'Page Updated' &)

  fi

                --Ken Pizzini

 
 
 

1. Shell script to check web pages...

Being relatively new to the shell scripting process, could anyone point
me in the right direction to write a bash shell script that will do a
post to a web server page, and check the return value...  I know how to
process the logic, and send an email, but can't figure a way to get a
response back from a server and process it...

i.e. I need to http://www.somewhere.com/test.asp?testval=1

and process the output...

Any help is appreciated...

Thanks,
JH

Jeffrey Hood
HM Consulting, Inc.
jhood (you - know - why) hmcon.com

2. Modem setup for dialin service

3. Utility to convert PowerPoint "web pages" into real web pages?

4. [2.5] BUG check in elevator.c:237

5. Newbie needs a little help on shell scripts (ksh)

6. Solaris performance tuning - Workshop analyzer question

7. A little help needed with a script and crontab

8. Xlib and Solaris threads

9. Check out my web page

10. Need good web makers for networking help page

11. Databse, Web pages, and other features.. Need help

12. Need help on making web page on SCO5

13. Bash Scripting: Little help with basic scripting