Skip to main content.
home | support | download

Back to List Archive

Re: Knowing whether spider.pl ended normally?

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Tue Jun 01 2004 - 18:46:02 GMT
On Tue, Jun 01, 2004 at 11:18:56AM -0700, Justin Tang wrote:
> Hi:
>   I'm modifying spider.pl to look for certain content in a site, and made a
> function to set $_[1]->abort++ if found.  Is there anyway to know if the
> spider was ended normally(not aborted) at the end of the spidering cycle? So
> I know whether or not the target content was found.  Thanks!

No, there's nothing in spider.pl that would indicate it.  Messages go to
STDOUT so you could capture that output.  Or you could do this in your
function:

    if ( $found ) {
        $_[1]->abort++;
        system('touch spider.aborted');
        system("echo 'spider aborted' | mail -s 'Spider Aborted' $pager_num");
        system("aumix -v100; mpg123 siren.ogg&");
        return;
    }

Remember, the config file is just perl code -- you can make it do anything.

-- 
Bill Moseley
moseley@hank.org
Received on Tue Jun 1 11:46:02 2004