PixelRat has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use IO::Handle; # Prints URL: and uses the input as STDIN. print "URL: "; INFO: while ($url = <STDIN>) { print "\n"; open(TMP, "> source"); print TMP `lynx -source $url`; print "\n"; print "Connecting to target.\n"; open(TEXT, "< source"); while (<TEXT>) { if ($_ =~ /^.* src=([^>]*)>.*$/ixg) { $text = $text . $1 . "\n"; } } TEXT->autoflush(1); close TEXT; print "Extracted image tags if any. \n"; $now = localtime; $check = `date -I`; open (LOG, ">> $check-spook.log"); print LOG "-------------------------\n", $url, $now, "\n-------------- +-----------\n"; print LOG $text . "\n"; print "Log has been written. \n"; print "Sleeping. \n"; unlink source; sleep 30; redo INFO; }
Edit: chipmunk 2001-11-23
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Strange Log
by chromatic (Archbishop) on Nov 23, 2001 at 04:56 UTC | |
by PixelRat (Sexton) on Nov 25, 2001 at 03:46 UTC | |
|
(ar0n) Re: Strange Log
by ar0n (Priest) on Nov 23, 2001 at 06:44 UTC | |
by joealba (Hermit) on Nov 23, 2001 at 10:17 UTC |