Author Topic: Hal:Dictionary: Another scraper, pure VBS.  (Read 61 times)

cyberjedi

  • Sr. Member
  • ****
  • Posts: 266
    • View Profile
Hal:Dictionary: Another scraper, pure VBS.
« on: April 12, 2017, 02:53:52 pm »
Rem Type=Plugin
Rem Name=Dictionary
Rem Author=cyberjedi
Rem Host=Assistant

'This sub sets up the plug-in's option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "This this reads word of the day"
    lblPlugin(0).Move 120, 120, 3300, 1200
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub

Rem PLUGIN: PLUGINAREA7

'Put ur trigger here, once again make sure all files are there.
' with out trigger it responds  to all input.
' Small dont mean weak, this is an awesome edition to Hal.
' This uses hal engine to do this.
'i just use a clock timer as a trigger.


Dim oDoc1 , con1
Dim dteWait


Set FSO = CreateObject("Scripting.FileSystemObject")

Set temp = FSO.OpenTextFile("voice.txt")
confirm_voice = temp.ReadLine()
temp.Close


Set oDoc1 = CreateObject("HTMLFile")
Set WshShell = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")



Set temp = fso.OpenTextFile("connectivity.txt") <<<<<- make a text file .
confirm = temp.ReadLine()
temp.Close

if (confirm = "online") then    <------ put this in it. online
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>"

dteWait = DateAdd("s", 1, Now())
Do Until (Now() > dteWait)
Loop



else
HalMenu.HalCommand "<SPEAK>" & "You are not connected to any active internet connections"& "</SPEAK>"
HalMenu.HalCommand "<SPEAK>" & "So , word of the day is not available ."& "</SPEAK>"

'SAPI.speak "You are not connected to any active internet connections"
'SAPI.speak "So , word of the day is not available ."

end if



' Build ur trigger enjoy
'This uses hals sapi05 engine to read the word of the day and its deffintions

'There is no trigger so as soon as u type txt its gonna read the website. For any questions  http://vaughnlive.tv/mrelectric
« Last Edit: April 16, 2017, 01:10:33 pm by cyberjedi »