VoiceGuide IVR Software Main Page
Jump to content

Search the Community

Showing results for tags 'finance.yahoo.com'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Found 1 result

  1. I'm having a problem with the Internet Portal sample script where when it runs, it repeats: "The Dow is trading at ZERO. The Nasdaq is trading a ZERO. The S&P is trading at ZERO." I don't know if this is a vbscript code error or if finance.yahoo.com changed something on their page since this vbscript sample code was written. Do you know what's happening in this situation? Please determine the accuracy of the sample and provide any fixes. Below is original Voiceguide internet portal vbscript. I am running vg 6.0.3991 Enterprise+Dialer --- if 1 then 'preferred approach is: 'connect and retrieve data by using XMLHTTP object Set objXMLHTTP = CreateObject("microsoft.XMLHTTP") objXMLHTTP.Open "GET", "http://finance.yahoo.com", False objXMLHTTP.Send If objXMLHTTP.Status <> 200 Then readWwwText = "" else readWwwText = objXMLHTTP.responseText Set objXMLHTTP = Nothing end if else 'another approach is: 'connect and retrieve data by starting up another instance of InternetExplorer Set IE = CreateObject("InternetExplorer.Application") With IE .RegisterAsDropTarget = False .Visible = False .Silent = True .Navigate("finance.yahoo.com") While .Busy WScript.Sleep 100 Wend With .Document.Body readWwwHtml = .InnerHTML readWwwText = .InnerText End With End With IE.Quit Set IE = Nothing end if 'iIndexDow = GetIntegerAfterLabel("Dow</a>") 'iIndexNasdaq = GetIntegerAfterLabel("Nasdaq</a>") 'iIndexSP500 = GetIntegerAfterLabel("P 500</a>") iIndexDow = GetIntegerAfterLabel("<span class=""streaming-datum"" id=""yfs_l10_^dji"">") iIndexNasdaq = GetIntegerAfterLabel("<span class=""streaming-datum"" id=""yfs_l10_^ixic"">") iIndexSP500 = GetIntegerAfterLabel("<span class=""streaming-datum"" id=""yfs_l10_^gspc"">") strResultVariables= "[MarketDow]{" & iIndexDow & "}" & _ "[MarketNasdaq]{" & iIndexNasdaq & "}" & _ "[MarketSP500]{" & iIndexSP500 & "}" 'make sure the returned data does not contain any commas strResultVariables = replace(strResultVariables, ",", "") set vg = CreateObject("VoiceGuide.CommandLink") vg.Run_ResultReturn $RV_DEVICEID, strResultVariables Set vg = Nothing function GetIntegerAfterLabel(strLabel) 'it is assumed that the integer terminates with a decimal point iLblPos1= Instr(readWwwText, strLabel) iValuePos1 = iLblPos1 + len(strLabel) iValuePos2 = Instr(iValuePos1, readWwwText, ".") strAfterLabel = mid(readWwwText, iValuePos1, iValuePos2-iValuePos1) 'msgbox strAfterLabel 'now remove everything except the digits. for i = 1 to len(strAfterLabel) ch = mid(strAfterLabel, i, 1) if ch >= "0" and ch <= "9" then GetIntegerAfterLabel = GetIntegerAfterLabel & ch end if next end function Internet portal log.zip
×