# # KEHOME/bin/google # Aug/18/2003 Oct/28/2005 Nov/6/2006 # Dec/30/2006 use google2mkr, don't output Client key # Google API Usage: # java com.google.soap.search.GoogleAPIDemo # <client-key> (search <query> | cached <url> | spell <phrase>) # google usage: # google option arg . systype.env export GOOGLE_HOME=/home/google case "$systype" in Linux) iexplore="/pf/Internet Explorer/iexplore.exe";; Mac) iexplore="/pf/Internet Explorer/iexplore.exe";; Cygwin) iexplore="/pf/Internet Explorer/iexplore.exe";; Interix)iexplore="/pf/Internet Explorer/iexplore.exe";; WinXP) iexplore="C:/Program Files/Internet Explorer/iexplore.exe";; Win98) iexplore="E:/Program Files/Internet Explorer/iexplore.exe";; Windows)iexplore="C:/WINDOWS/iexplore.exe";; esac directory="http://www.google.com/dirhp?hl=en&tab=wd&ie=UTF-8&oe=UTF-8&q=" case "$1" in home) "$iexplore" "$KEHOME"/bin/Google.url;; directory) "$iexplore" "$directory";; spell|cached) cd $GOOGLE_HOME/googleapi; key=$(cat google.key); demo="com.google.soap.search.GoogleAPIDemo"; #set -x; java -cp googleapi.jar "$demo" "$key" "$1" "$2" | grep -v 'Client key';; search) cd $GOOGLE_HOME/googleapi; key=$(cat google.key); demo="com.google.soap.search.GoogleAPIDemo"; #set -x; java -cp googleapi.jar "$demo" "$key" "$1" "$2" | google2mkr;; *) echo "usage: google home" >&2; echo "usage: google directory" >&2; echo "usage: google search query" >&2; echo "usage: google cached url" >&2; echo "usage: google spell phrase" >&2; exit;; esac #