Author Topic: Word of the Day Scraper  (Read 4153 times)

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Word of the Day Scraper
« on: June 07, 2017, 02:46:14 pm »
Rem Type=Plugin
Rem Name=word of the day
Rem Author=cyberjedi
Rem Host=Assistant


'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 = True
'Determines that you are talking about the wordoftheday
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(HalCommands)
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
   
 
« Last Edit: June 18, 2017, 01:38:42 pm by cyberjedi »

lordskorpz

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Word of the Day Scraper
« Reply #1 on: March 30, 2018, 07:29:02 pm »
Where is the link for the plugin? I really want to try this one out!

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3848
    • View Profile
Re: Word of the Day Scraper
« Reply #2 on: March 30, 2018, 10:42:40 pm »
It is actually in front of you. Simply Drag/highlight all of the text and do a COPY.

Open NotePad, click on it and do a PASTE.

Now FILE > SAVE AS and give it a name such as WOTD-SCRAPER.uhp or similar to suit you.

That's it.

Most Plug-ins are ordinary Text files. The magic is in knowing what to do with that text!  ;)

Hope this helps!
In the world of AI it's the thought that counts!

- Art -

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Re: Word of the Day Scraper
« Reply #3 on: April 10, 2018, 06:25:29 pm »
Art Thank you


hahhaha



best wishes cyberjedi lmaoooo

lightspeed

  • Hero Member
  • *****
  • Posts: 6761
    • View Profile
Re: Word of the Day Scraper
« Reply #4 on: April 12, 2018, 11:45:32 am »
not seeing the Forrest for the tree's , we have all been their .  "I still am sometimes lol !" THANKS CYBERJEDI  FOR THE PLUG IN !