>-----original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Subject: [REBOL] Need a Script Re:(2)
>
>
>Russ thanks for the help. I am trying to make a script to check a site
every
>xx:xx minutes and see if a specific word on a page exists. if not send me
>email... and do this forever...
>
>Regards,
>Philip M. McDonnell
-----------------------

Fellow Rebols!
I've been lurkin' on this list forever, learning all the time. Finally a
question I can answer:

Philip, your request comes just as I've managed by trial + error to do just
what you requested: Please check it out and lemme know if it works for you
... I've had it running for just over a week and it works like a charm -
although there are certainly many improvements some of the real expert
rebols can suggest...

-------------------snip--------------------------------------------

REBOL [
    Title: "WebSiteCheck"
    File:  %webchk.r
    Date:  22-Oct-1999
    Purpose: "Check a set of sites every 5 minutes & mail an error response
only once"
    Author: "Andre Venter"
]
secure none 

sites: [
        "Site 1" http//www.site1.com "1"
        "Site 2" http//www.site2.com "1"
        "Page2" http//www.site1.com/page2.htm "1"
                ]
        
while [ true ][
        foreach [name url status] sites [ 
        start: fourth now
        either error? try [read url][
                if status = "1" [ 
                        message: reform ["Rebol Alert:" name "is down!"]
                        send [EMAIL PROTECTED] message  ; -----------//insert
your mail adr. here
                        change status "0"]
                                ]       
                        [change status "1"]
                stop: fourth now
                if stop - start >= 0:00:45 [  ; -----------// change timeout
to suite your needs
                        if status = "1" [
                                message: reform ["Rebol Alert:" name "timed
out!"]
                                send [EMAIL PROTECTED] message ;
-----------//insert your mail adr. here
                                ]
                        ]       
                ]
        print reform [fourth now "Pausing for 5 min"]
        wait 0:05:00 ; ------------  //change to suite your needs
        ]

---------------------------snip------------------------------

PS. many, many thanks to all for all the tips, insights and inspiration!
Rebol On!
Andre Venter   [EMAIL PROTECTED]

Reply via email to