I need a script that searches words from www.urbandictionary.com and
www.dictionary.com if possible also www.thesaurus.com for words when
executed. Displaying the #1 result. First it would check if the word
is in dictonary.com than urbandictionary.com. When using thesaurus.com
you would use a different command. I need help with the para string,
and stat strings of the websites. I can make the commands and
executables. Here is some code that might be useful for you guys if
need be or you can use your own way.


content = InetOpen("http://dictionary.reference.com/search?q="&word)
if instr(content, "No entry found for") <> 0 then
call defUrban(word, user, mode)
exit sub
end if
data = split(content, "<LI TYPE=""a"">")

if ubound(data) = 0 then
info = split(content, "<DD>")
if ubound(info) > 3 then
for i=1 to ubound(info)
newdef = mid(info(i), 1, instr(info(i), "<")-1)
call displayText(i & ": " & newdef, " ", BotVars.Username, 1)
next
else
for i=1 to ubound(info)
newdef = mid(info(i), 1, instr(info(i), "<")-1)
call displayText(i & ": " & newdef, " ", BotVars.Username, 1)
next
end if
if ubound(info) = 0 then
call defUrban(word, user, mode)
end if
exit sub
end if


'else if ubound(data) > 0, when there is a list of definitions...
if ubound(data) > 3 then
call handleText(user, "Found " & ubound(data) & " entries for "&
word & ". Here are three.", mode)
for i=1 to 3
newdef = mid(data(i), 1, instr(data(i), "<")-2)
call displayText(i &": " & newdef, " ", BotVars.Username, 1)
next
else
for i=1 to ubound(data)
newdef = mid(data(i), 1, instr(data(i), "<")-2)
call displayText(i & ": " & newdef, " ", BotVars.Username, 1)
next
end if
End Sub

Sub defUrban(word, user, mode)
if ScINet.stillExecuting then
call handleText(user, "The bot is busy... wait a few seconds and
try again.", mode)
exit sub
end if

content = InetOpen("http://www.urbandictionary.com/define.php?
term="&word)
if instr(content, "is undefined") <> 0 then
call handleText(user, "Failed to find a definition using both a
dictionary and an urban dictionary.", mode)
exit sub
end if
defArray = split(content, "<div class=""def_p"">")
if ubound(defArray) = 0 then
call handleText(user, "Failed to find a definition using both a
dictionary and an urban dictionary.", mode)
exit sub
end if
defcount = 0
found = false
for i=1 to ubound(defArray)
if instr(defArray(i), "1.") = 0 then
found = true
def = mid(defArray(i), instr(defArray(i), "<p>"))
def = mid(def, 1, instr(def, "</p>")-1)
def = replace(def, "&quot;", "")
'addchat vbyellow, def
while instr(def, "<") <> 0
pos1 = instr(def, "<")
pos2 = instr(def, ">")
temp = mid(def, pos1, pos2-pos1+1)
def = replace(def, temp, "")
wend
addchat vbred, len(def)
def = replace(def, " ", " ")
def = replace(def, vbnewline, "")
def = replace(def, vbtab, "")
def = replace(def, cr, "")
def = replace(def, lf, "")
def = replace(def, ctlf, "")
def = replace(def, " ", " ")
call displayText(word & ": " & def, " ", BotVars.Username, 1)
defcount = defcount + 1
if defcount = 1 then exit sub
end if
next
if found = false then call handleText(user, "Definition exists on
urban dictionary, but not on dictionary.com - Definition could not be
displayed.", mode)
End Sub