SpellCheck

By PoiXon on Apr 22, 2005

type /spell "word" and it will check the first word from www.spellcheck.net and it will echo it into a window ( @spell )

alias spell {
  if ($1) {
    if ($sock(spell)) { sockclose spell | unset %spell | unset %thing }
    set %spell $1
    sockopen spell www.spellcheck.net 80
  }
}
on *:sockopen:spell: { 
  if ($sockerr) { 
    echo -a Error Halting
    sockclose spell
  }
  else {
    sockwrite -n spell GET /cgi-bin/spell.exe?action=CHECKWORD&string= $+ %spell HTTP/1.1
    sockwrite -n spell HOST: $+ www.spellcheck.net $+ $crlf $+ $crlf
  }
}
on *:sockread:spell: {
  if (!$sockerr) {
    var %spel
    sockread %spel
    window -l @spell
  }
  if (<BR><font color=#990033><B>* iswm %spel) {
    aline 12 @spell $htmlfree(%spel)
    aline 12 @spell You probably mean...
  }
  if (*<BR> iswm %spel) {
    aline 4 @spell $replace(%spel,<BR>,$chr(46))
    lol
  }
  if (*<font color=#006600><B>* iswm %spel) {
    dline @spell 1
    aline 12 @spell $htmlfree(%spel)
    dline @spell 3
  }
}
alias lol {
  set %l $calc(1 + 2)
  while ($line(@spell,%l)) {
    inc %l
    dline @spell %l
  }
}
alias -l htmlfree { 
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&) 
  return %x 
}

Comments

Sign in to comment.
DarthReven   -  Apr 22, 2005

nice little socket

 Respond  
xDaeMoN   -  Apr 22, 2005

This is nice but I doesnt update the window if you requested another word.

 Respond  
www-   -  Apr 22, 2005

nice one Poixon ,no more discussions bout the right spelling

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.