Hunting the SNARK with JavaScript

If you surf the web with Netscape 2.0, you can use JavaScript to put a handy, compact search engine interface ("SNARK") on your home page.

Why, here's a SNARK now:



Note that if you leave the query field blank, pressing "GO" will take you to that search engine's home page.

To capture a SNARK for yourself, just save this document's HTML source, clip out the <SCRIPT>...</SCRIPT> section in the middle, and paste it into your own home page.


It's easy to customize your SNARK's list of search engines. Inside the script, each engine is added with a command like this:
   Add("the Web: Yahoo!",
       "",
       "http://www.yahoo.com/",
       "http://search.yahoo.com/bin/search?p=hunting+the+snark" );
The four components of an engine are its name, an option string (usually empty), its home page, and its search URL. To find an engine's search URL, manually use that engine to perform a search for the special string "hunting the snark". If the URL of the search results document contains the string hunting+the+snark, then this engine can be added to your SNARK following the example above.

Frequently asked questions

Why can't I see the SNARK forms?
Because you're not running a JavaScript-enabled version of Netscape. A Snark is completely invisible to non-JavaScript browsers.

Why's it called SNARK?
Because it's meant to help you hunt things down. I guess it should really be called Snark-Hunter. Lewis Carroll poem

Can SNARK interface to search engines that accept input via the POST method?
No. However, many search engines will accept both GET and POST based queries. To find out, save a local copy of the html page with the engine's search form on it, and edit the <FORM ...> tag to use method="GET" instead of method="PUT". See if a search with this newly-modified form works. If so, you can add this engine to SNARK.

Are there other SNARK'ish utilities out there?
Yes. See WebXSPUR (uses JavaScript + frames) and CUSI (uses CGI to same effect).

Email comments to jab+snark@cs.cmu.edu
Created 27-Jan-1996