' For those who think Hals Plugin language is week:
'I hope u guys can enjoy this as Much as me.
' It can used as a standalone .EXE that run By calling to from Hal.
',Or better yet, this bad boy can be formatted to Hals Brain as a plugin.
'remremSimply put (open wiki.exe) after u compile this of course.
' But the real magic is using this as a Plugin.
' I supplied the raw source do as u Please. for any questions , i can be reached here
http://vaughnlive.tv/mrelectric ' Make sure you put the files in the same directory as the vbs/uhp
' For plugin, save as .uhp
'For Standalone, save as .vbs .Walaaaaaa. enjoy
'Build trigger/triggers and ur done. Its not a big deal to port the response to Hals output. I demonstrated how in another plugin.
'You will get a popup window that i left in the plugin. because of running into Multi-Choice output in Wiki.
'Ull figure it out.Just play with it BEFORE u make the plugin itself.
'Best wishes
'cyberjedi
'*********************************
On Error Resume Next
Const SVSFlagsAsync = 1
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
Dim oDoc1 , oDoc2 , oDoc3 ,oDoc4 , con1 , con2 , con3
Set oDoc1 = CreateObject("HTMLFile")
Set oDoc2 = CreateObject("HTMLFile")
Set oDoc3 = CreateObject("HTMLFile")
Set oDoc4 = CreateObject("HTMLFile")
Set con1 = CreateObject("MSXML2.ServerXMLHTTP.6.0")
Set con2 = CreateObject("MSXML2.ServerXMLHTTP.6.0")
Set con3 = CreateObject("MSXML2.ServerXMLHTTP.6.0")
Set WshShell = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
SAPI.speak "Enter keyword to do a Cyber search " , SVSFlagsAsync
URL1 = "
https://en.wikipedia.org/w/index.php?title=Special:Search&search="
Keyword = InputBox("Cyberjedi search ","Cyberjedi Voice Search")
If Keyword = "" then
wscript.Quit
Else
Sapi.speak "Please Wait ."
end if
tempURL1 = URL1 & Keyword & "&fulltext=Search&profile=default"
con1.Open "GET", tempURL1 , False
con1.Send
oDoc1.Write con1.responseText
'wscript.echo("Response recieved")
if oDoc1.GetElementsByTagName("b")(0) is nothing then
'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
tempTxt1 = oDoc1.GetElementsByTagName("div")(17).InnerText
'wscript.echo("tempTxt1 filled with "&tempTxt1)
if tempTxt1 = "" then
'B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3
SAPI.speak "Sorry your entered keyword does not match any titles of articles . Check the spelling ."
'B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3
else
Select Case tempTxt1
Case "Did you mean: " & oDoc1.GetElementsByTagName("a")(

.InnerText
'B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1
SAPI.speak "Sorry for the inconvenience caused , but this minor part of the program is under development ."
'B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1
Case "Showing results for " & oDoc1.GetElementsByTagName("a")(

.InnerText & ". Search instead for " & Keyword & "."
'B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2
SAPI.speak "Showing results for " & oDoc1.GetElementsByTagName("a")(

.InnerText , SVSFlagsAsync
SAPI.speak "Please wait , while that opens ." , SVSFlagsAsync
tempTxt1 = oDoc1.GetElementsByTagName("a")(12).href
tempTxt2 = Right(tempTxt1, Len(tempTxt1) - 6)
URL2 = "
https://en.wikipedia.org" & tempTxt2
con2.Open "GET", URL2 , False
con2.Send
oDoc2.Write con2.responseText
temptemp = Right(oDoc2.GetElementsByTagName("p")(0).InnerText , 13)
if temptemp = "may refer to:" then
SAPI.speak "This specific keyword , has many references ."
SAPI.speak "Select the correct choice ."
tempLen1 = oDoc2.GetElementsByTagName("li").length - 3
val = 0
For loopvar = 0 to tempLen1
if oDoc2.GetElementsByTagName("li")(loopvar).InnerText = "Disambiguation pages" then
Exit For
end if
if val > 2 then
SAPI.speak "Is this ?" , SVSFlagsAsync
else
SAPI.speak "Is this the article you are searching for ?" , SVSFlagsAsync
end if
tempTxt3 = MsgBox (oDoc2.GetElementsByTagName("li")(loopvar).InnerText, vbYesNo + vbQuestion, "Is this the article you are searching for ?")
Select Case tempTxt3
Case vbYes
SAPI.speak "Please wait , while that opens ." , SVSFlagsAsync
tempTxt4 = oDoc2.GetElementsByTagName("li")(loopvar).InnerHtml
oDoc4.write tempTxt4
tempTxt5 = oDoc4.getElementsByTagName("a")(0).href
tempTxt6 = Right(tempTxt5, Len(tempTxt5) - 6)
URL3 = "
https://en.wikipedia.org" & tempTxt6
con3.Open "GET", URL3 , False
con3.Send
oDoc3.Write con3.responseText
SAPI.speak oDoc3.GetElementsByTagName("p")(0).InnerText
if oDoc3.GetElementsByTagName("p")(1) is nothing then
wscript.Quit
else
SAPI.speak oDoc3.GetElementsByTagName("p")(1).InnerText
end if
wscript.Quit
Case vbNo
val = val + 1
End Select
Next
SAPI.speak "Sorry your entered keyword does not match any titles of articles . Check the spelling ."
wscript.Quit
else
tempTxt1 = oDoc1.GetElementsByTagName("a")(

.href
tempTxt2 = Right(tempTxt1, Len(tempTxt1) - 6)
URL2 = "
https://en.wikipedia.org" & tempTxt2
con2.Open "GET", URL2 , False
con2.Send
oDoc2.Write con2.responseText
SAPI.speak oDoc2.GetElementsByTagName("p")(0).InnerText
if oDoc2.GetElementsByTagName("p")(1) is nothing then
wscript.Quit
else
SAPI.speak oDoc2.GetElementsByTagName("p")(1).InnerText
end if
wscript.Quit
end if
'B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2
End Select
'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
end if
else
SAPI.Speak oDoc1.GetElementsByTagName("b")(0).InnerText , SVSFlagsAsync
SAPI.speak "Please wait , while that opens ." , SVSFlagsAsync
tempTxt1 = oDoc1.GetElementsByTagName("a")(

.href
tempTxt2 = Right(tempTxt1, Len(tempTxt1) - 6)
URL2 = "
https://en.wikipedia.org" & tempTxt2
con2.Open "GET", URL2 , False
con2.Send
oDoc2.Write con2.responseText
temptemp = Right(oDoc2.GetElementsByTagName("p")(0).InnerText , 13)
if temptemp = "may refer to:" then
'A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1
SAPI.speak "This specific keyword , has many refernces ."
SAPI.speak "Select the correct choice ."
tempLen1 = oDoc2.GetElementsByTagName("li").length - 3
val = 0
For loopvar = 0 to tempLen1
if oDoc2.GetElementsByTagName("li")(loopvar).InnerText = "Disambiguation pages" then
Exit For
end if
if val > 2 then
SAPI.speak "Is this ?" , SVSFlagsAsync
else
SAPI.speak "Is this the article you are searching for ?" , SVSFlagsAsync
end if
tempTxt3 = MsgBox (oDoc2.GetElementsByTagName("li")(loopvar).InnerText, vbYesNo + vbQuestion, "Is this the article you are searching for ?")
Select Case tempTxt3
Case vbYes
SAPI.speak "Please wait , while that opens ." , SVSFlagsAsync
tempTxt4 = oDoc2.GetElementsByTagName("li")(loopvar).InnerHtml
oDoc4.write tempTxt4
tempTxt5 = oDoc4.getElementsByTagName("a")(0).href
tempTxt6 = Right(tempTxt5, Len(tempTxt5) - 6)
URL3 = "
https://en.wikipedia.org" & tempTxt6
con3.Open "GET", URL3 , False
con3.Send
oDoc3.Write con3.responseText
SAPI.speak oDoc3.GetElementsByTagName("p")(0).InnerText
if oDoc3.GetElementsByTagName("p")(1) is nothing then
wscript.Quit
else
SAPI.speak oDoc3.GetElementsByTagName("p")(1).InnerText
end if
wscript.Quit
Case vbNo
val = val + 1
End Select
Next
SAPI.speak "Sorry your entered keyword does not match any titles of articles . Check the spelling ."
wscript.Quit
'A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A1
else
'A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2
tempTxt1 = oDoc1.GetElementsByTagName("a")(

.href
tempTxt2 = Right(tempTxt1, Len(tempTxt1) - 6)
URL2 = "
https://en.wikipedia.org" & tempTxt2
con2.Open "GET", URL2 , False
con2.Send
oDoc2.Write con2.responseText
SAPI.speak oDoc2.GetElementsByTagName("p")(0).InnerText
if oDoc2.GetElementsByTagName("p")(1).InnerText = "" then
wscript.Quit
else
SAPI.speak oDoc2.GetElementsByTagName("p")(1).InnerText
end if
wscript.Quit
'A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2
end if
end if