alias dict {
%string = $replace($1-,$chr(32),+)
sockopen DICT dictionary.com 80
}
on *:SOCKOPEN:DICT:{
sockwrite -n $sockname GET /search?q= $+ %string
sockwrite -n $sockname Host: dictionary.com.org $+ $crlf $+ $crlf
}
on *:SOCKREAD:DICT:{
if ($sockerr) {
echo -a Error!
}
else {
var %socktext
sockread %socktext
if (<TABLE>* $+ $replace(%string,+,$chr(32)) $+ * iswm %socktext) {
echo -a $left($htmlfree(%socktext),$len(%string))
}
if (<OL><LI> isin %socktext) {
commands to get definition out of HTML
}
}
}
alias htmlfree {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
return %x
}