#!/bin/sh
##
## let's call this `new nlook' == nnlook		strauss, Nov 1996
##

if [ $# -eq 0 ] ; then
	echo "Usage: nnlook <pattern>"
	echo " Note: for more details, see http://www.leo.org/cgi-bin/dict-search.pl"
	exit 0
fi

#URLPREFIX=http://www.leo.org/cgi-bin/dict-search.pl?search=
URLPREFIX=http://wais.leo.org/cgi-bin/dict-search.pl?search=
PATTERN=`echo $@ | tr ' ' '+'`
FILE=/tmp/nnlook.$$
PATH=/usr/local/bin:$PATH

scotty -c "http get $URLPREFIX$PATTERN $FILE" >/dev/null

cat $FILE | sed -n \
	-e 's/^.*<LI>//' \
	-e 's/<\/*B>//g' \
	-e '/Search results for/,/<\/UL>/p' |
	egrep -v '</*UL>|<BR>|Search results for'

rm -f $FILE
