Jump to content
Sign in to follow this  

Fridays' Swyx Tip #5: Real-Time Data From Web

Tom Wellige

45 views

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.

 

ExchangeRate.zip

 

Function:

  1. Inbound call
  2. Script retrieves exchange rate from www
  3. Script plays result back to caller

 

WLW-realtimedatafromweb_14537-ExchangeRateScriptInlcYahoo.jpg

 

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.

 

Happy swyxing...

 

Regards
Mirjam

 

@ IT Net World Ltd, NZ & AUS SWYX Distributor

http://www.itnetworld.co.nz/

 

 

Don't miss to take a look onto the ECR Useful Link Collection for more such examples.

 



0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.