
Dear Swyx Users
Did you know that Swyx can access data directly from a web page?
In this example, the finance website from Yahoo is checked and the latest exchange rate on New Zealand Dollar-Euro is retrieved. Then the information is played back to the caller.
Function:
1. Inbound call > 2. Script retrieves exchange rate from www > 3. Script plays result back to caller
How can Swyx do this? By using the graphical script editor and a VB script statement, Swyx can access information from the website.
‘ ‘ VB script statement ‘ ‘
Function dollar()
Dim http_req, pos
Set http_req = CreateObject("Msxml2.ServerXMLHTTP.3.0")
http_req.open "GET", "http://finance.yahoo.com/q?s=NZDEUR=X&d=0b", False
http_req.send()
pos = instr(http_req.responseText,"Last Trade")
dollar = mid(http_req.responseText, pos+52,6)
end function
The original version of this script can be found on the Swyx Knowledge base article KB2650.
This is just a small example on how to retrieve real-time data from a online source. If you have further question please don’t hesitate to contact me.
Happy swyxing . . . . .
Regards
Mirjam
@ IT Net World Ltd, NZ & AUS SWYX Distributor