Rem Type=Plugin
Rem Name=word of the day
Rem Author=cyberjedi
Rem Host=Assistant
'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "'word of the day '"
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
'onthecuttingedge2005: If u liked the other, ull love this shizit... (fistbump))
'After we talked i came up with this.
'What an interesting way to get Hal to learn.
' key word = WOTD (check WOTD)
'Hal reads and parses The word of the day from
http://dictionary.reference.com/wordoftheday/'Hal ports the word of the day through Haptek's engine
'This was a real joy
' On my weirdshizitometer this ranks a solid 9.5
'Copy and paste this code to a .UHP =Done
'Or just dl the UHP
Rem PLUGIN: PRE-PROCESS
'The preceding comment is actually a plug-in directive for
'the Ultra Hal host application. It allows for code snippets
'to be inserted here on-the-fly based on user configuration.
HalBrain.ReadOnlyMode = False
'Determines that you are talking about the wordoftheday
'GetW = HalBrain.TopicSearch(UserName, "UserWeather")
If InStr(1,InputString, "wotd",1) > 0 Then
UltraHal = Getwotd(HalCommands)
'ElseIf InStr(1,InputString, "wotd",1) > 0 Then
End If
Rem PLUGIN: FUNCTIONS
Function Getwotd(UserName)
Dim oDoc1 , con1
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Sapi = CreateObject("SAPI.SpVoice")
For Each Voice In Sapi.GetVoices
i = i + 1
Next
For loopvar = 0 to i-1
if loopvar = CInt(confirm_voice) then
Set Sapi.Voice = Sapi.GetVoices.Item(loopvar)
end if
Next
Set oDoc1 = CreateObject("HTMLFile")
Set WshShell = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
HalMenu.HalCommand "<SPEAK>" & "Please wait ." & "</SPEAK>"
Set con1 = CreateObject("MSXML2.ServerXMLHTTP.6.0")
URL = "
http://dictionary.reference.com/wordoftheday/"
con1.Open "GET", URL , False
con1.Send
oDoc1.Write con1.responseText
HalMenu.HalCommand "<SPEAK>" & "Word of the day is , " & oDoc1.GetElementsByTagName("strong")(0).InnerText & " , which means , " & oDoc1.GetElementsByTagName("ol")(0).InnerText & "</SPEAK>"
End Function