O'Reilly Hacks
oreilly.comO'Reilly NetworkSafari BookshelfConferences Sign In/My Account | View Cart   
Book List Learning Lab PDFs O'Reilly Gear Newsletters Press Room Jobs  



HACK
#87
Google Whacking
With over 2 billion pages in its index, is it possible to get only one result for a search?

Contributed by:

[03/13/03 | Discuss (134) | Link to this hack]

With an index of over 2 billion pages, Google attracts lots of interest from searchers. New methods of searching are tested, new ways of classifying information are explored, new games are invented.

New games are invented? Well, yes, actually. This is the Internet, after all.

The term "Google whacking" was coined by Gary Stock. The idea is to find a two-word query that has only one result. The two words may not be enclosed in quotes (that's too easy), and the words must be found in Google's own dictionary (no proper names, made-up words, etc). If the one result comes from a word list, such as a glossary or dictionary, the whack is disqualified.

If you manage a Google whack—and its harder than it sounds—be sure to list your find on the official Whack Stack (http://www.googlewhack.com/). Perusing the most recent 2,000 whacks is highly recommended if your brain is stuck and you need a little inspiration in your research. Examples include "endoscopy cudgels," "nebbish orthodontia," and "peccable oink."

Are you stuck for a Google whack query? This hack should help. It takes a random word from each of two "word of the day" sites and queries Google in hopes of a Google whack (or as experienced players would say, "To see if they make a whack").

#!/usr/local/bin/perl
# google_whack.pl
# An automated Google whacker.
# Usage: perl google_whack.pl

# Your Google API developer's key
my $google_key='insert key here';

# Location of the GoogleSearch WSDL file
my $google_wdsl = "./GoogleSearch.wsdl";

use strict;

# Use the SOAP::Lite and LWP::Simple Perl modules
use SOAP::Lite;
use LWP::Simple;

# Generate some random numbers to be used as dates for choosing 
# random word one.
srand(  );
my $year  = int( rand(2) ) + 2000;
my $month = int( rand(12) ) + 1; 
$month < 10 and $month = "0$month";
my $day = int( rand(28) ) +1;
$day < 10 and $day = "0$day";

# Pulling our first random word from Dictionary.com
my $whackone = 
  get("http://www.dictionary.com/wordoftheday/archive/$year/$month/$day.html") 
  or die "Couldn't get whack word 1: $!";
($whackone) = 
  ($whackone =~ /<TITLE>Dictionary.com\/Word of the Day: (.*)<\/TITLE>/i);

# Generate a new year between 1997 and 2000 for choosing
# random word two
srand(  );
$year  = int( rand(5) ) + 1997;

# Pulling our second random word from th  now defunct Maven's 
# Word of the Day (thank goodness for archives)
my $whacktwo = 
  get("http://www.randomhouse.com/wotd/index.pperl?date=$year$month$day") 
  or die "Couldn't get whack word 2:: $!";
($whacktwo) = ($whacktwo =~ m!<h2><B>(.*)</b></h2>!i);

# Build our query out of the two random words
my $query = "$whackone $whacktwo"; 

# Create a new SOAP::Lite instance, feeding it GoogleSearch.wsdl
my $google_search = SOAP::Lite->service("file:$google_wdsl");

# Query Google
my $results = $google_search -> 
    doGoogleSearch(
      $google_key, $query, 0, 10, "false", "",  "false",
      "", "latin1", "latin1"
    );

# A single result means a possible Google whack
if ($results->{'estimatedTotalResultsCount'} == 1) {
  my $result = $results->{'resultElements'}->[0];
  print 
    join "\n",
      "Probable Google whack for $query",
      "Title: " . $result->{title}||'no title',
      "URL: $result->{URL}",
      "Snippet: " . $result->{snippet}||'no title',
      "\n";
}

# Anything else is Google jack 
else {
  print "Google jack for $query, with " . 
    $results->{'estimatedTotalResultsCount'}  . " results\n";
}

  • I got this in 5 minutes!
    2005-01-05 12:09:04  beccaleigh [Reply | View]

    toeless candleabra
  • google whack
    2005-01-09 03:37:55  smevor [Reply | View]

    alacritous princeps
  • We did it!
    2005-01-11 07:28:32  Tamsquared [Reply | View]

    Muddleheaded Cheroot
    • We did it!
      2005-02-28 06:53:07  soxgal85 [Reply | View]

      now look it up again, it doesn't work. sorry - i know from experience, it happed to me too
  • Got the bugger
    2005-01-18 03:50:45  robertwalton [Reply | View]

    Took about half an hour

    Volksgemeinschaft pomegranate
  • yaay i found a google whack
    2005-01-18 08:04:42  XxViCkY16xX [Reply | View]

    i onli got 1 result for >>
    horovitz batrachomyomachia
  • tryed and tryed and still no luck........
    2005-01-25 07:23:05  donna_eac [Reply | View]

    i have been trying to find a google whack for ages and i cannot find 1 anywhere
    • tryed and tryed and still no luck........
      2005-01-28 15:06:13  soxgal85 [Reply | View]

      try :
      persnipity + horse

      .....it should work, i tried it a second ago
    • tryed and tryed and still no luck........
      2005-04-02 12:48:01  busterboy [Reply | View]

      cant find a whack? well try inebrieted orangutans
  • incandescent antiestablishmentarian
    2005-01-27 09:16:09  dd2005 [Reply | View]

    it works
    • incandescent antiestablishmentarian
      2005-01-27 09:17:09  dd2005 [Reply | View]

      this turns up nothing and i found it in about 2 minutes of searching
  • subservient tickle gefilte jewish
    2005-01-28 17:16:03  philcutlip [Reply | View]

    first google whack
    • subservient tickle gefilte jewish
      2005-04-01 12:25:02  FuriousGeorge160 [Reply | View]

      The google whack can only be 2 words, no numbers, no qoutes and each word between 4 and 30 letters. Caps rarely make a difference. Tard.
  • i found a whack
    2005-02-09 10:46:22  ChrisFlynn [Reply | View]

    the whack is

    ''froogles blinks''
    • i found a whack
      2005-02-25 07:47:25  yes!! [Reply | View]

      by writing the google whack you found, it is no longer a whack as it now has 2 more results refering to this website. have fun finding another to replace it!!!

      yes!!
      • i messed it up myself!
        2005-02-28 06:46:47  soxgal85 [Reply | View]

        i know and i messed it up too. it really stinks to find one and mess it up yourself. but i guess it gives me an excuse to keep on whacking.
    • i found a whack
      2005-04-01 11:54:30  lizard75 [Reply | View]

      not anymore! google that again and there will be 5 sites if not more...very tricky these googlewhacks...
      • i found a whack
        2005-04-05 11:14:53  Khleo [Reply | View]

        AA'cantatas Cool Eh!?
        • HEY LOOKIE HERE
          2005-04-05 12:55:35  Khleo [Reply | View]

          I found This Other wack Catutions Farm
          • HEY LOOKIE HERE
            2005-04-05 12:59:25  Khleo [Reply | View]

            THE WHACK IS fewerly
            • HEY LOOKIE HERE
              2005-04-05 13:02:59  Khleo [Reply | View]

              Dawrin heer
              • HEY LOOKIE HERE
                2005-04-05 13:07:28  Khleo [Reply | View]

                Groger Gourge
                • HEY LOOKIE HERE
                  2005-04-05 13:20:41  Khleo [Reply | View]

                  Gutterz mutters
                  • HEY LOOKIE HERE
                    2005-04-05 13:22:52  Khleo [Reply | View]

                    Casablanka junipers
                    • Wow
                      2005-04-05 13:30:46  Khleo [Reply | View]

                      Doing pretty good Not so bad within an hour Oh here is another one Enodthermic rxns I must say That the younger generation can come up with pretty outragous words
                      • Wow
                        2005-04-05 13:36:12  Khleo [Reply | View]

                        bunnyhop H8er
                        • Wow
                          2005-04-07 14:13:34  Khleo [Reply | View]

                          Another1 it's Grantula nothing
  • i found a google whack
    2005-03-14 15:23:57  neowiggs [Reply | View]

    Jackal manohra
  • FOUND A GOOGLE WHACK
    2005-04-01 07:51:49  Googler [Reply | View]

    hoogle gorges
  • i believe that i have successfully found a google whack...
    2005-04-01 09:21:30  roadkiller1 [Reply | View]

    porkfish russophobia
  • www.googlewhack.com
    2005-04-01 12:22:56  FuriousGeorge160 [Reply | View]

    There are tons of google whacks found, go to www.googlewhack.com to find listings. Mine is vampiress nematode, and it's realyl not that hard, you just have to have a wide vocabulary. vampiress nematodes has no listings though, I'm not sure if this will register with google, if it does, then there's now a new one.
  • I found a Google Whack!!!!
    2005-04-01 19:23:20  rcracingfan [Reply | View]

    YES! after only about ten minutes I found one, using a word from a previous whack.



    Test this one out:



    Persnipity jazz



    YES!!!! What now, huh?



    YES!!!!
  • I've got three fresh ones.
    2005-04-09 16:17:04  FuriousGeorge160 [Reply | View]

    astroplane nematode, astroplane gnome, astroplane fickle
  • simple whack !!!
    2005-04-28 08:49:26  lordndrew [Reply | View]

    this whack goes just like this > larumma
    simple right.
  • haha
    2005-11-09 07:03:19  iPimp [Reply | View]

    SPANNKY POTATO
  • allys google whack
    2005-12-21 07:52:55  ally_the_google_master [Reply | View]

    jelopino beef
  • yay, another one by the al man
    2005-12-21 08:06:17  ally_the_google_master [Reply | View]

    super moosefans
    • yay, another one by the al man
      2005-12-21 08:09:36  ally_the_google_master [Reply | View]

      moosephants
      • yay, another one by the al man
        2006-03-04 13:58:24  poopie [Reply | View]

        hello
    • yay, another one by the al man
      2005-12-21 08:09:48  ally_the_google_master [Reply | View]

      moosephants, 1 word google whack
  • Loop me baby
    2005-12-30 15:53:27  tomythius [Reply | View]

    I've never used perl before, so apologies if this is a faux pas:
    Add 4 lines and make it loop until it finds one :)
    At line 18 add:
    my $found=0;
    while (!$found){

    At line 70 (after the end of the join statement anyway) add:
    $found = 1;
    And right at the end of the file add a
    }
    Magic.
  • whack
    2006-01-23 07:55:31  seddero [Reply | View]

    tarsier polygomy
  • new google whack descoverd!
    2006-02-13 02:41:19  tarquinplug [Reply | View]

    "tarquin plug" is a google whack. Well it was untill I posted this. another google whack destrotyed!
  • new one yay!!!!!!!!!!!!!!!!!!
    2006-04-22 21:42:25  akwardsilencexxo [Reply | View]

    piddy deoxyribonucleic

    just tested it!!! yeahh! go me! and person 2 my right!!!!!!!!!!! :-D
  • 2 more baby!!!!!!!!
    2006-04-22 21:58:59  akwardsilencexxo [Reply | View]

    heffalump anuss

    and swhit endorphin


    yeahhh thats 3 for us!!!! :-p
  • moooore from mwah!
    2006-07-16 12:07:59  akwardsilencexxo [Reply | View]

    endorphin fitje

    uhh thats it



  • I FOUND A GOOGLEWHACK!!
    2006-09-25 06:17:43  chloe.murg [Reply | View]

    antidisestablishmentarism illuminatus!!!!! IT WORKS AND I CHECKED THE DICTIONARY AND THEY ARE REAL WORDS!!! HEHE...
  • LOL googlewhack!!
    2006-09-25 06:21:59  chloe.murg [Reply | View]

    PNEUMONO­ULTRA­MICRO­SCOPIC­SILICO­VOLCANO­CONIOSIS
    THRUSH!! me and my friends, Lucy, Vicky nd kate were bored in sociology so i taught them the rules of googlewhacking!! so fun nd addictive!
    xxxxx

  • another 1 for you!
    2006-09-25 06:31:47  chloe.murg [Reply | View]

    Donaudampfschiffahrtsgesellschaftskapitän butcher (vicky)
  • and........another 1!!! we r sooo bored lol we r not sad either
    2006-09-25 06:38:35  chloe.murg [Reply | View]

    antidisestablishmentarism supplemental hehe btw these have all been checked in the dictionary... sorry ppl we r destroying these googlewhacks cos we found them u didnt!!!
    hahaha xxx
    oo anutha 1 2....
    Asseocarnisanguineoviscericartilaginonervomedullary fish
    xxxx
    hehehahaha!!
    xxx we r jus 2 good for u internet geeks!!!
  • hello agen!!
    2006-09-25 06:50:09  chloe.murg [Reply | View]

    antidisestablishmentarism liverpudlian

Showing messages 1 through 129 of 129.

O'Reilly Home | Privacy Policy

© 2007 O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.