Jargoogle - Jargon File search with Google
content="HTML Tidy for Linux/x86 (vers 1st February 2002), see www.w3.org" />
content="text/html; charset=iso-8859-1" />
content="Mozilla/4.06 [en] (WinNT; I) [Netscape]" />
Just drag the appropriate links onto your personal toolbar:
I'm told that these won't work on MSIE 6; I also think they won't work before Netscape 4 and MSIE 4. Try them and please report any failures (see email at bottom).
Can somebody explain to me why the same search (try `foo bar' (two
words)) gives different results on Netscape and MSIE?
How does it work?
There is no magic to it; no search engine called Jargoogle was setup by me; it's just a convenient interface to Google hiding an additional restriction added to your request.
Google's feature used
Note: All my knowledge of Google's features is all acquired by expirement/guessing and might be inaccurate/incomplete/intrustable/incorrect.
The word "site" followed by a colon enables you to restrict your search to a specific site. To do this, use the "site:sampledomain.com" syntax in the Google search box.I tried it and although it actually accepts only domain names, it gets accurate results when searching for a jargon term within www.tuxedo.org (that's the domain where the Jargon File resources page resides). For example searching for:
foobar site:www.tuxedo.orgresults in:
as the first match, which is the Right Page.
Google CGI Interface for it
Note: I don't know CGI well; the terminology might differ from the accepted one.
Google has two CGI interfaces that provide same input for the search engine from different form inputs. The first is the simple search at `http://www.google.com/search?' and the second is the advanced search at `http://www.google.com/advanced_search?'.
Both searches accept two submit inputs: `btnG' for normal search and `btnI' for "I'm feeling lucky" searches. Only their presence matters; the values are ignored, which allows freedom in the button names (the value is taken from the button name which is not a great design decision IMHO). Hint: if nothing is found (press random keys for search text :), you will be able see the search string and URL actually with "I'm feeling lucky".
The Jargoogle search form is a cut-down version of Google Advanced search form. It includes only the main `as_q' field and a hidden `as_sitesearch' field set to `www.tuxedo.org'
In the absence of either submit inputs the simple search defualt to regular (unlucky :-) Google search and the advanced search presents the adnvaced search page with the value of `as_q' parsed into the various boxes. That's used tby Google to switch from simple search to advanced search when you have already typed part of the search. I used it to make the Google logo point to the advance search page initialized with the domain restriction.
The toolbar buttons provided by Google also provide a `client' input with `googlet' value which seems to do nothing (I tried both ways). I left it in, guessing that they might be collecting statistics of toolbar button usage, and the Jargon version probably should be included.
The first thing that is done is to try to get the selection to simplify search of a jargon term appearing on some web site. This is (of course) not portable accross browsers, especially contsidering that we have to check for the selection in every frame:
The second thing to do is to prompt for the search string if no selection was found. This code could be portable if the check was - I haven't tried to make it the same on both browsers (lazyness...) but if it's a real difference it might result from the above Netscape code giving 0 or null vs. the MSIE code giving an empty string if no selection is found. The string split for readability by me:
The last thing left to do is to create the URL unless "Cancel" was pressed. (Loading seems to be automagically triggered by the change of the current location). At least this is portable. Even the check is, probably because prompt() returns 0 or null if "Cancel" is pressed in both browsers.
Of course no closing semicolon is needed as this is the last statement. It's known that all C-inspired languages use Pascal syntax ;-).
If you want to have an "I'm feeling lucky" search, just add the `btnI' input:
Now you just have to combine these together.
The "research" was performed and documented in this page by Beni Cherniavsky. Please email with any corrections/improvements you have.