[clue-tech] Fun perl script

Mike Staver staver at fimble.com
Tue Aug 1 10:56:31 MDT 2006


I'll definitely share some stories as soon as I get it working here. I 
tried what Jeff suggested, and it worked only for google searches. 
Meaning, if I type in "Windows" under a search on google, the results 
page is full of linux results. That's cool, but not what I was 
expecting.  I was hoping to be able to have the any word on the page be 
replaced, so I still have some tweaking to do.  I've tried different 
variations like:

#!/usr/bin/perl
$|=1;
$count = 0;
$pid = $$;
while (<>) {
         chomp $_;
         if ($_ =~ /(.*\.jpg)/i) {
                 $url = $1;
                 system("/usr/bin/wget", "-q", 
"-O","/space/WebPages/images/$pid-$count.jpg", "$url");
                 system("/usr/bin/mogrify", 
"-flip","/space/WebPages/images/$pid-$count.jpg");
                 print "http://10.0.0.16/squid/$pid-$count.jpg\n";
         }
         elsif ($_ =~ /(.*\.gif)/i) {
                 $url = $1;
                 system("/usr/bin/wget", "-q", 
"-O","/space/WebPages/images/$pid-$count.gif", "$url");
                 system("/usr/bin/mogrify", 
"-flip","/space/WebPages/images/$pid-$count.gif");
                 print "http://10.0.0.16/squid/$pid-$count.gif\n";

         }
         elsif ($_ =~ /(Clinton|Bush|Reagan|Castro|Gibson)/i) {
                 print "Staver";
         }
         elsif ($_ =~ /(Windows|Microsoft)/i) {
                 print "Linux";
         }
         else {
                 print "$_\n";;
         }
         $count++;
}

However, my variations to the script seem to have no effect on the 
output...

Joe 'Zonker' Brockmeier wrote:
> On 8/1/06, Mike Staver <staver at fimble.com> wrote:
>> That's, that's what I was looking for.  I'll see what kind of havoc I
>> can cause today.
> 
> Now there's a slogan for Perl 6! "What kind of havoc do you want to
> cause today?" :-)
> 
> I wonder if Larry would be willing to adopt that instead of "There's
> more than one way to do it." (Alternately, "There's more than one way
> to cause havoc.")
> 
> Best,
> 
> Zonker

-- 

                                 -Mike Staver
                                  staver at fimble.com
                                  mstaver at globaltaxnetwork.com



More information about the clue-tech mailing list