English Vocabulary Definition Checker

Platform:  mIRC
Published  Sep 21, 2011
Updated  Sep 22, 2011
This is yet another request by California who wishes to have a formal English definition checker.

The command is once again self-explanatory:
Code
 
<Jethro> !check jaytea
<Bot> No Search Result Found for "jaytea"
<Jethro> !check napa
<Bot> Definition: Plant with an elongated head of broad stalked leaves resembling celery.
<Jethro> !check approbation
<Bot> Definition: Official approval.
<Jethro> !check abstruse
<Bot> Definition: Difficult to penetrate.
<Jethro> !check food for thought
<Bot> Definition: Anything that provides mental stimulus for thinking.
You can also use a self-trigger !check <word> from your own input using the same command and its prefixes.
on *:sockclose:dict*:{
tokenize 96 $sock($sockname).mark
$5 No Search Result Found for $qt($replace($1,+,$chr(32)))
}
on *:sockopen:dict*:{
tokenize 96 $sock($sockname).mark
if ($sockerr) { $5 There's an issue for connection! | halt }
$2 GET $+(/?Query=,$1,&button=Search) $3
$2 Host: $+($sock($sockname).addr,$str($crlf,2)) | $2 $4
}
on *:input:*: if ($regex($1-,/^[!@.]check( |$)/iS)) dict $2-
on $*:text:/^[!@.]check( |$)/iS:*:{
if (!$2) { .notice $nick Syntax: !check <Word> }
elseif (%fc) { .notice $nick You can only check a definition every 3 seconds! }
else { inc -u3 %fc $+($network,$cid,$wildsite) | dict $2- }
}
alias -l dict {
var %dict $+(dict,..,$str($ticks,5),..,$cid,..,$network,..,$site)
$+(sock,$iif($sock(%dict),close,open) %dict freedictionary.org 80)
sockmark %dict $+($replace($strip($1-),$chr(32),+),`,sockwrite -nt %dict,`,$&
HTTP/1.0,`,Connection: close,`,$iif($event = input,msg,.msg) $iif(#,#,$nick))
}
on *:sockread:dict*:{
tokenize 96 $sock($sockname).mark
if ($sockerr) { $5 There's an issue reading the website! | halt }
var %dict | sockread %dict
if ($regex(%dict,/<span class="d(efinition)">(.*)<\/span>/U)) {
$5 $+($chr(2),$+(D,$regml(1)),:,$chr(2)) $+($regsubex($right($regml(2),$&
-1),/^(.)/,$upper(\1)),.) | sockclose $sockname
}
}

Comments

Sign in to comment.
alabama   -  Oct 16, 2011

Apparently someone lowered it out of spite.

So if you gave me a 9, someone would have to score me a 1 or 2 to lower my overall rating. Whoever scored people's snippets badly without a reason why is simply a lame duck. I can easily guess who did it, but I won't mention "him" to divulge his childish act. I know I deserve much better than that son of a gun.


i gave it a 10
 Respond  
Pangaea   -  Oct 07, 2011
heh, yea i do worry myself sometimes
 Respond  
jaytea   -  Oct 07, 2011
well it's a good thing we're 5 years and 25 versions past 6.2 ;) otherwise, yes, that would be a real worry.
 Respond  
Pangaea   -  Oct 07, 2011
dont think this will work with 6.2
 Respond  
irchainscriptz   -  Sep 23, 2011
Nice snippet jethro!!
 Respond  
blackvenomm666   -  Sep 23, 2011
its no problem jethro we all know you don't deserve a score like that
 Respond  
x1L22   -  Sep 23, 2011
Thank youuu Excellent
 Respond  
Jethro   -  Sep 23, 2011
Thank you all again for bumping up my score rating after someone's lame attempt to make it look bad.
 Respond  
napa182   -  Sep 23, 2011
You are welcome Jethro.
 Respond  
Jethro   -  Sep 22, 2011
Yes, it's for a good laugh is all. Of course, napa can mean a number of things. This script has been made to merely fetch the first, single result relevant to the definition you're checking.

And thank you, napa182.
 Respond  
napa182   -  Sep 22, 2011
lol @ SunnyD
an nice lil socket Jethro 9/10 +Like
 Respond  
SunnyD   -  Sep 22, 2011
Note to self: Napa is a plant with an elongated head of broad stalked leaves resembling celery.

Haha that was a good laugh. :P
 Respond  
Jethro   -  Sep 22, 2011
Thank you all for your kind and generous support toward my work.
 Respond  
GrimReaper   -  Sep 22, 2011
Nice snippet Jethro_, Nice output and everything.. Gave a Like and 10 rating because the score as it was, Was not good enough imo, Someone being jealous and lowering the score like that is well out of order..
 Respond  
blackvenomm666   -  Sep 22, 2011
yes yes dean can be a bit juevenile can't he? haha nicely done jeth +like and i'll boost your score for ya specially since it was lowered out of jealousy
 Respond  
Jethro   -  Sep 22, 2011
Apparently someone lowered it out of spite.

So if you gave me a 9, someone would have to score me a 1 or 2 to lower my overall rating. Whoever scored people's snippets badly without a reason why is simply a lame duck. I can easily guess who did it, but I won't mention "him" to divulge his childish act. I know I deserve much better than that son of a gun.
 Respond  
chachin   -  Sep 22, 2011
thanks.. another great snippet from the great Jethro 9/10 :D
 Respond  
alabama   -  Sep 22, 2011
cool
 Respond  
Jethro   -  Sep 21, 2011
I've edited a minor oversight.
 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.