Search Terms perl script
I just managed to get a script working to pull back search terms for this domain, and boy did I get some crackers, my favourites are:
see men pissing in obscure places
"football socks" sex -school
"george formby grill"
victoian windows (high ranking google spelling mistake)
where are sticklebricks
Chuckle Brothers 18 May 2003
I have a mad script, which I have hacked together, in true cut and paste style which appears to work. I nicked the regular expression stuff from the CPAN's http://www.cpan.org/authors/id/R/RD/RDUARTE/searchengineterms-1.0.pl, which I don't understand, combining it with some Damien Conway 'Cheating Under UNIX' examples from the Data Munging course, and produced this monstrosity, for all you geeks to laugh at.
(movable type seems to have mangled the <> operator in the while loop which has LOGFILE between the sideways hats).
see men pissing in obscure places
"football socks" sex -school
"george formby grill"
victoian windows (high ranking google spelling mistake)
where are sticklebricks
Chuckle Brothers 18 May 2003
I have a mad script, which I have hacked together, in true cut and paste style which appears to work. I nicked the regular expression stuff from the CPAN's http://www.cpan.org/authors/id/R/RD/RDUARTE/searchengineterms-1.0.pl, which I don't understand, combining it with some Damien Conway 'Cheating Under UNIX' examples from the Data Munging course, and produced this monstrosity, for all you geeks to laugh at.
(movable type seems to have mangled the <> operator in the while loop which has LOGFILE between the sideways hats).
use strict;
use URI::Escape;
my %unique;
foreach my $textfile () {
if (substr($textfile,-3) eq '.gz'){
$textfile = "gzip -dc $textfile |";
}
open LOGFILE, $textfile;
while (<LOGFILE>){
if ( m#\Wq(?:ry|kw|uery\?p)?=([^&\s?]+)# ){
my $string = uri_unescape($1);
$string =~ tr/\+/ /;
chop($string) if (
(scalar($string=~tr/"//) % 2 != 0) &&
(rindex($string,'"') == (length($string)-1))
);
$unique{$string}++;
}
}
}
print "$_\n" foreach (keys %unique);
close(LOGFILE);
Comments
I once got a search for "nachos fraternity solution problem". I'm guessing it was Googled by a fraternity in search of nachos, the solution to which should be fairly obvious:
1) Make nachos
or
2) Buy nachos
I'm not really sure how a search engine ever entered into the equation...
Posted by: Emily | May 29, 2003 10:54 PM
That's a quality search. I can just see some fat lazy stoner, dying for some munchies, but being too lazy to do anything about it, hoping (way beyond realistic expectations) for a nachos service specialising in fraternity deliveries.
Posted by: Andy | May 30, 2003 08:21 AM
MT didn't eat the angle brackets, the browser is rendering non-existant html for you. Try again with the entities < and >
Posted by: Russell | June 4, 2003 02:35 PM
Thanks Russell, it worked with the lt and gt.
Cheers
Posted by: jaffs | June 4, 2003 02:57 PM