2
« on: June 21, 2006, 12:41:47 pm »
Sorry if I didn't make it clear.
All most people need to do is copy/paste the text you see in the message into your brain. That's it.
If you are a more advanced user and you want to host the Perl script on your own server then you would download the attached script, upload it to your cgi-bin, and set the permissions of it to 755.
If you just want to get it working... copy this into your brain under the Wordnet Dictionary Function. Then load up Hal and type "Show me an airplane." or "Show me a deer." or whatever.
'RESPOND: LOOK UP IMAGE
If InStr(1, UserSentence, "SHOW YOU ", 1) > 0 Then
lookup = Replace(UserSentence, "SHOW YOU ", "", 1, -1, vbTextCompare)
If InStr(1,lookup,".", 1) > 0 Then lookup = Replace(lookup,".","",1,-1, vbTextCompare)
If InStr(1,lookup," A ", 1) > 0 Then lookup = Replace(lookup," A ","",1,-1, vbTextCompare)
If InStr(1,lookup," AN ", 1) > 0 Then lookup = Replace(lookup," AN ","",1,-1, vbTextCompare)
If WN.LookUpWord(lookup) = False Then
GetResponse = "I have no definition but I will try to find an image."
End If
If WN.LookupWord(lookup) = True Then
GetResponse = GetResponse & lookup & ": " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "D") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "S") & ". " & WN.GetDefinition(WN.GuessPartOfSpeech, 1, "E") & "." & vbCrLf & "<EXCLUSIVE>"
End If
Set IE = CreateObject("InternetExplorer.Application")
cdc = "http://www.karigirl.com/cgi-bin/popup.pl?term=" + lookup + "&secs=5" 'Secs until window closes. 0=never
IE.Navigate cdc
IE.AddressBar = False
IE.menubar = False
IE.ToolBar = False
IE.StatusBar = False
IE.width = 450
IE.height = 450
IE.resizable = False
IE.visible = True
End If