Created
March 2, 2010 21:01
-
-
Save jhannah/319937 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use strict; | |
| use diagnostics; | |
| use warnings; | |
| use IPC::System::Simple qw(run system capture EXIT_ANY); | |
| use WWW::Search; | |
| $SIG{ALRM} = sub { die "timeout" }; | |
| my $random_word = random_dictionary_word(); | |
| my $oSearch = new WWW::Search('MSN'); | |
| my $sQuery = WWW::Search::escape_query("Shopping $random_word"); | |
| $oSearch->native_query($sQuery); | |
| while (my $oResult = $oSearch->next_result()) { | |
| my $border = $oResult->url; | |
| print $oResult->url, "\n"; | |
| system( [0..255], "php.exe scan.php $border"); | |
| } | |
| sub random_dictionary_word { | |
| srand; | |
| open my $in, "<", "mydictionary.txt" or die "Can't open mydictionary.txt"; | |
| my $it; | |
| while <$in> { | |
| rand($.) < 1 && ($it = $_); | |
| } | |
| return $it; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment