alias tran {
sockopen tran www.vandale.nl 80
set %zoekwoord $1
}
on 1:sockopen:tran: {
sockwrite -n $sockname GET /opzoeken/woordenboek/?zoekwoord= $+ %zoekwoord HTTP/1.0
sockwrite -n $sockname Host: www.vandale.nl
sockwrite -n $sockname Connection: keep-alive
sockwrite $sockname $crlf
}
alias -l nohtml {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
return %x
}
on 1:sockread:tran: {
if ($sockerr > 0) return
:nextread
sockread %tran
if ($sockbr == 0) {
return
}
if (RESULTAAT isin %tran) {
echo -a $nohtml(%tran)
}
if (%zoekwoord isin %tran) {
echo -a $nohtml(%tran)
}
if (U hebt gezocht op isin %tran) {
echo -a RESULTAAT: 0
}
goto nextread
}