current version: 0.21: fixes a first time run bug

cligoogle is a small tcl script i wrote (using tclsh8.3) to do command line googling of search terms. it probably violates googles terms of use, so please keep that in mind. you could really foul it up for the rest of us!

USAGE:

usage: google.tcl term1 [term2 ...] [!?]
        choose ! if you feel lucky
        choose ? to go to google's results

to configure the google tool:
google.tcl -config  
        element is one of browser, number, lang, or proxy
        values can be:
                browser: netscape, konq, mozilla
                number: number of results to return
                lang: support for en, es, de, and fr
                proxy: url and port (ie proxy.my.com:8080) (not implemented yet)
example:
$ google jose nazario
1       http://www.monkey.org/~jose/
2       http://www.monkey.org/~jose/presentations/thesis-defense/
3       http://biocserver.bioc.cwru.edu/~jose/
4       http://www.jose.nazario.com/
5       http://www.crimelabs.net/docs/
6       http://bsdsearch.com/eao/phorum/list.php?f=5
7       http://bsdsearch.com/eao/phorum/list.php?f=5&r=1
8       http://www.memoriaviva.com/Desaparecidos/D-G/godoy-a3.htm
9       http://lists.insecure.org/nmap-hackers/2000/Apr-Jun/0100.html
10      http://www.maximumbsd.com/
or, you can feel lucky and have your browser window luckified:
$ google jose nazario ! 
(what you dont see is my netscape window open up to link one up there).

$ google mandarin oranges ?
(what you don't see is my netscape window going to the google results page.)

DOWNLOAD:

version 0.1: google.tcl - outdated
version 0.2: cligoogle-0.2 - 24 jul 02
version 0.21: cligoogle-0.21 - 24 jul 02 - minor bugfix for first time use
Changelog:

#       support global config
#               supports browser type, number of results to return, language
#       cleanup some of the skipped line regexps
#       support konq, rick wash
#       support mozilla, win32 and unix, jeff godin
#       use defang for lucky urls, seth arnold
#       option to be taken to the google search results page
#       configurable option of number of results to gather
#       simplify href parsing, increasing accuracy
now includes "dictionary", to search dictionary.com for arbitrary words.

INSTALLATION:

requires: tcl 8.3 or higher. thats it. it uses a hand rolled http connection to do the query.

i have this set up for openbsd's tcl8.3 from ports. it has been set up to support netscape 4.7, mozilla (on UNIX and Win32), and konquerer. tested on OpenBSD only.

NOTE

this is a beta release. it may get some things wrong, it may chop some URLs and results poorly. it does only boolean OR queries (i haven't yet taught it phrases). its pretty ugly code. this could stop working at any time if google changes their html templates.

i would appreciate feedback on making it work on windows, on other forms of UNIX with mozilla, opera, and IE (ie on windows, solaris, HPUX). the lucky feature is what needs some help.

CONTACT

jose at monkey dot org

LICENSE

i have released this under a BSD style license. the license is in the code comments.

thanks, and i hope you find this useful.

google is copyright 2002 google, inc. they are not at all involved in this.
Wed Jul 24 08:51:55 EDT 2002