Okay, I want to be able to print out the correct definition of a word from time to time.
Here is my script:
In the alias section:
d {
sockopen dictionary m-w.com 80
%temptext = $$1
set %number 0
}
striphtml {
if ($1) {
var %strip,%parm = <> $remove($1-,> <,><,$chr(9)) <>,%n = 2
while ($gettok($gettok(%parm,%n,62),1,60)) {
%strip = %strip $ifmatch
inc %n
}
return %strip
}
}
And in the remote:
on *:sockopen:dictionary:{
sockwrite -n $sockname GET /cgi-bin/dictionary?book=Dictionary&va=%20 $+ %temptext HTTP/1.1
sockwrite -n $sockname Host: m-w.com $+ $crlf $+ $crlf
}
on *:sockread:dictionary:{
if ($sockerr) {
echo Error.
halt
}
else {
sockread %temptext
if (Main* iswm $striphtml(%temptext)){ echo $striphtml(%temptext) | set %number 1 }
if (%number == 1 ) { echo $striphtml(%temptext)}
if (%number == 1){ if (Get* iswm $striphtml(%temptext)) { set %number 0 } }
}
}
Please you have to help me even if you have to go to the site. I don't know what's wrong. That should from what I can see give me everything between 'main' and 'get' right?
It would be pretty darn cool as well to give them a link to the playing of the sound if that were possible.