# # WWW access library # # 1999-05-09 naddy BROWSER='lynx -nocolor -cookies' # # Search engines # google() { button='Google Search' case $1 in -f) button="I'm feeling lucky" shift if [ $# -eq 0 ]; then echo 'usage: google [[-f] search terms]' >&2 return 2 fi ;; esac case $# in 0) $BROWSER http://www.google.com/ ;; *) $BROWSER "http://www.google.com/search?q=$(queryencode "$*")&sa=$(queryencode "$button")" ;; esac } fast() { case $# in 0) $BROWSER http://www.alltheweb.com/ ;; *) $BROWSER "http://www.alltheweb.com/cgi-bin/search?query=$(queryencode "$*")" ;; esac } # # Merriam-Webster online dictionary & thesaurus # webster() { case $# in 0) $BROWSER http://www.m-w.com/dictionary.htm ;; 1) $BROWSER "http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va=$(queryencode "$1")" ;; *) echo "usage: webster [word]" >&2; return 2 ;; esac } thesaurus() { case $# in 0) $BROWSER http://www.m-w.com/thesaurus.htm ;; 1) $BROWSER "http://www.m-w.com/cgi-bin/thesaurus?book=Thesaurus&va=$(queryencode "$1")" ;; *) echo "usage: thesaurus [word]" >&2; return 2 ;; esac } #### EOF ####