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: 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 (not implemented yet)
$ google jose nazario
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.)


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

#       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 for arbitrary words.


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.


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.


jose at monkey dot org


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