#!/usr/bin/perl # # By Iron # Visit http://www.randombase.com for more junk # use LWP::Useragent; use Getopt::Std; getopt('kpo', \%opts); if($opts{'k'} eq '') { usage(); } if($opts{'o'} ne '') { open(out,">".$opts{'o'}) or print "Couldn't open output file!"; } if($opts{'p'} eq '') { $opts{'p'} = 1; } for($start = 0;$start != $opts{'p'}*10;$start += 10) { $t = "http://www.google.com/search?hl=en&q=".$opts{'k'}."&btnG=Search&start=".$start; $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->env_proxy; $ua->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12"); $response = $ua->get($t); if ($response->is_success) { $c = $response->content; @stuff = split(/ # # -k -> KEYWORD # -p -> PAGES (amount of pages to search) (optional) # -o -> OUTPUT FILE (optional) # # Example: perl google.pl -k randombase rocks -p 3 -o google.txt #"; exit; }