Author Topic: Image of the day  (Read 313 times)

cyberjedi

  • Hero Member
  • *****
  • Posts: 772
  • The Mighty Hal Machine
    • View Profile
Image of the day
« on: April 16, 2022, 10:18:38 am »
By popular demand i redid  Image of the day.
Direct action plugin
Nasa IOTD
The power of this iddy biddy bit of code cant be quantified....Enjoy
Trigger is Open IOTD




Rem Type=Plugin
Rem Name=Image of the day
Rem Author=Zabaware, Inc.
Rem Host=Assistant

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  '<<<<<<<<What do u think is gonna happen if you set that flag to false
'Determines that you are talking about the Image of the day
If InStr(1,InputString, "IOTD",1) > 0 Then
 UltraHal = GetIOTD(HalCommands)
ElseIf InStr(1,InputString, "IOTD",1) > 0 Then
 End If
 
 

Rem PLUGIN: FUNCTIONS
Function GetIOTD(HalCommands)

Dim oDoc1 , con1
Dim objExplorer

Set WshShell = CreateObject("Wscript.Shell")
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
Set Sapi.Voice = Sapi.GetVoices.Item(loopvar)
Next
Set oDoc1 = CreateObject("HTMLFile")
Set WshShell = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
 
Set objExplorer = CreateObject("InternetExplorer.Application")
Set con1 = CreateObject("MSXML2.ServerXMLHTTP.3.0")
URL = "https://earthobservatory.nasa.gov/topic/image-of-the-day"
con1.Open "GET", URL , False
con1.Send
oDoc1.Write con1.responseText

objExplorer.Navigate URL
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 940
objExplorer.Height = 970
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1

HalMenu.HalCommand "<SPEAK>" & "From the mind of cyber jedi" & "</SPEAK>"

HalMenu.HalCommand "<SPEAK>" & "This is the featured image of the day" & "</SPEAK>"
HalMenu.HalCommand "<SPEAK>"& oDoc1.GetElementsByTagName("img")(4).alt & "</SPEAK>"
if oDoc1.GetElementsByTagName("p")(2) is nothing then

else

end if

End Function
« Last Edit: April 16, 2022, 11:25:20 am by cyberjedi »

Art

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3714
    • View Profile
Re: Image of the day
« Reply #1 on: April 16, 2022, 04:51:01 pm »
Nicely done Cyber!

Good stuff!
In the world of AI it's the thought that counts!

- Art -

lightspeed

  • Hero Member
  • *****
  • Posts: 6657
    • View Profile
Re: Image of the day
« Reply #2 on: April 17, 2022, 10:18:14 pm »
will try it out , thanks