Zabaware Forums > Ultra Hal Assistant File Sharing Area
Image of the day
cyberjedi:
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
Art:
Nicely done Cyber!
Good stuff!
lightspeed:
will try it out , thanks
Honvai:
Can i have Image of the mood extension?
Art:
What do you mean, Image of the Mood extension?
That plugin was for The Image of the Day but not some mood extension that I'm aware.
Just copy & paste the text and save it as IOTD.uhp and include it in the Ultra Hal 7 folder.
Then activate it in the Brain Options menu by selecting in from those in the scroll list.
Navigation
[0] Message Index
[#] Next page
Go to full version