David Welton (davidw in the tcl chatroom) writes:
# Simple interface to http://dict.org/ server
proc dict { word } {
set sk [ socket dict.org 2628 ]
fconfigure $sk -translation crlf
fconfigure $sk -buffering none
puts $sk {client "tcldict"}
puts $sk "define * \"$word\""
puts $sk {quit}
while { ![ eof $sk ] } {
gets $sk line
puts $line
}
close $sk
}
dict $argv
The basis for the code above is the protocol described in RFC 2229 [L1 ]