#!/usr/bin/perl use IO::Handle; # Prints URL: and uses the input as STDIN. print "URL: "; INFO: while ($url = ) { print "\n"; open(TMP, "> source"); print TMP `lynx -source $url`; print "\n"; print "Connecting to target.\n"; open(TEXT, "< source"); while () { 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; }