Author Topic: Hal takes a ride down Nasdaq Lane: Just because he could. Status  (Read 2010 times)

cyberjedi

  • Hero Member
  • *****
  • Posts: 810
  • The Mighty Hal Machine
    • View Profile
Rem Type=Plugin
Rem Name= Nasdaq
Rem Author= cyberjedi
Rem Host=All



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 Nasdaq
If InStr(1,InputString, "Nasdaq",1) > 0 Then
 UltraHal = Getnasdaq(HalCommands)
ElseIf InStr(1,InputString, "Nasdaq",1) > 0 Then
 End If
  ' onthecuttingedge2005: U ask for this, well ,Cyber pulls another rabbit out of his (***) Hat
  ' This bad boy is a Nasdaq Scraper with a twist, All the data Scraped is ported through Hals Voice.  It took cyberjedi to pull it off. Enjoy. 
  ' Trigger= Nasdaq. 
  'I put this together while listening to this. -->>>https://www.youtube.com/watch?v=aqXW57WM9TA
  'Follow me in to the jungle. http://vaughnlive.tv/mrelectric
 ' I give myself a solid 7.5 on cool ideas here
 'Once again make sure that ur SAPI05 engine is on and working
 'This mean the lips must MOVE...lol
' Wana take the time to thank LifeTimeGamer  who took a leap of faith and works with me
' tirelessly and beta test all the code. And watches my dumb movies.
' Shout out to onthecuttingedge2005 Trigger refinement


Rem PLUGIN: FUNCTIONS
Function Getnasdaq(HalCommands)

Const SVSFlagsAsync = 1
Const DontShowWindow = 0
Const WaitUntilFinished = 1
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
if loopvar = CInt(confirm_voice) then
Set Sapi.Voice = Sapi.GetVoices.Item(loopvar)
end if
Next
Set xmlDoc = CreateObject("Microsoft.XMLDOM")
Set WshShell = CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
HalMenu.HalCommand "<SPEAK>" & "Reading headlines !" & "</SPEAK>"
For loopvar = 0 to 2
If tempconfirm = loopvar then
if tempconfirm = 1 then
HalMenu.HalCommand "<SPEAK>" & "Currently reading " & confirm & " latest headlines" & "</SPEAK>"
else if tempconfirm = 1 then
HalMenu.HalCommand "<SPEAK>" & "Okay ." & "</SPEAK>"
wscript.quit
else
HalMenu.HalCommand "<SPEAK>" & "Currently reading " & confirm & " latest headlines " & "</SPEAK>"
end if
end if
xmlDoc.async = false
xmlDoc.load("http://articlefeeds.nasdaq.com/nasdaq/categories?category=US%20Markets&format=xml")
Set nodelist = xmlDoc.selectNodes("rss/channel/item")
i = 3
For Each item In nodelist
Set f1 = item.selectsinglenode("title")
Set f2 = item.selectsinglenode("description")
HalMenu.HalCommand "<SPEAK>" & f1.text & "</SPEAK>"  ' these two lines are the Magic of the plugin
HalMenu.HalCommand "<SPEAK>" & f2.text & "</SPEAK>"  ' these two lines are the Magic of the plugin
i = i + 1
if i = tempconfirm then
wscript.Quit
end if
Next
end if
Next
End Function
« Last Edit: June 18, 2017, 01:36:38 pm by cyberjedi »