#!/bin/bash # wget.cgi - WWW gateway to Webster's English Dictionary. # Author: Thomas Hallgren # http://www.cse.chalmers.se/~hallgren/ # For non-commercial use only. AUTOHEADER=no . bin/cgistart.sh title="Webster's English Dictionary" CNT=`count_cookie wget_visits` echo "Set-Cookie: wget_visits=$CNT; expires=31-dec-2009 23:59:59 GMT" cnt=`cat log/wget_counter` cgiheaders echo >>log/wget_log "${REMOTE_HOST-$REMOTE_ADDR} _ _ ["`date "+%d/%b/%Y:%H:%M:%S %Z"`"] $HTTP_USER_AGENT [$CNT visits]" case "$*" in "") thistitle="$title";; *) thistitle="$title: $*" esac logo=`imgalt "/Img/book09.gif" "" "class=right width=33 height=29"` #doctype_html40loose pagestart "$thistitle" "$logo $title" begin div class=body tag isindex if [ -n "$*" ]; then h2 "$*" F=/tmp/wget$$ if webster "$*" >$F ; then begin pre whtml <$F end else echo "$* wasn't found in the dictionary, but here are" echo "some similar words:" begin dir agrep -2 "^$*\$" web.words | sed 's%^.*$%
  • &%' end fi rm $F cnt=`expr "$cnt" + 1` echo "$cnt" >log/wget_counter fi #echo "There has been $cnt searches in the dictionary since" #echo "27 October 1996." #[ "$CNT" -gt 3 ] && echo "It seems you have used this page at least $CNT times." #echo ':-)' end div nl link "about.html" About;echo " this web page." begin address link "http://www.altocumulus.org/~hallgren/" TH pageend