Fridays' Swyx Tip #5: Real-Time Data From Web
From 2009 to 2011 mirjam baumberger wrote a great blog, the "Fridays' Swyx Tip". Every Friday she posted a tip regarding the usage of SwyxWare and connected tools and devices. As the old forum is offline, this article series will be restored here again over the time. Please note that some information in this article series might not be valid anymore with current SwyxWare versions.
This blog article was originally posted on 08.01.2009 10:07
Dear Swyx Users
Did you know that Swyx can access data directly from a web page?
In the following downloadable 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.
- Inbound call
- Script retrieves exchange rate from www
- 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 Custom VBScript Code - Access Web Page Within A Script (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.
@ IT Net World Ltd, NZ & AUS SWYX Distributor
Don't miss to take a look onto the ECR Useful Link Collection for more such examples.
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now