X-log : Let the data flow!

 

Click to see the XML version of this web page.

 
 

Turning Your Browser into a Real-Time Data Receiver

(Note: This demonostration only works in IE.  If you aren't running IE, you probably won't see anything.)

I have prepared a demonstration that turns your browser into a real-time data receiver using Radio's builtin support for web services.

Prepare for the Demonstration

In order for the demonstration to work, you will need to download these files: .

The steps for installing these files are:  

  1. Download the zip file and put it somewhere safe.
  2. Open the zip file.
  3. Extract the files using folder information.  It is important that you use the "All files" and "Use Folder Names" options when extracting.  Otherwise, the necessary folders and files will not be in the right places.
  4. Point to the directory one level above your Radio UserLand installation.  So, if you have Radio installed in "C:\Program Files\Radio UserLand\",  point to "C:\Program Files".  The zip file will put everything in the Radio UserLand directory.
  5. Extract the files.  There should be a file called "webLogUpdates.txt" in your "Radio UserLand\Web Services" directory.  There should be a new folder in "www" called "myServices."  "myServices" should contain "#pref.txt", "#template.txt", "webLogUpdates.txt", and "webLogUpdates_html.txt."  "#pref.txt" tells Radio not to render this folder.  "#template.txt" is a generic HTML file template and Radio CSS.  "webLogUpdates.txt" contains the XML-RPC call to the web service.  "webLogUpdates_html.txt" is the HTML snippet you can add to your templates.
  6. Reload this page.

The last you want to make sure of is that you have Radio running.

What It Does

This demonstration does a number of things.  What you should be seeing is an inline frame that contains the ten most recently updated weblogs from Weblogs.com.  The data in this frame refreshes every 30 seconds.  You can click on one of the weblogs and go to it.

There are three components to making this work:  the inline frame, the myServices page, and the web services.  The inline frame provides the container for the data to be placed without affecting the entire page and the script that triggers the reload.  The myServices  page calls the "webLogUpdates" web service via XML-RPC in your Web Services directory.  The web service retrieves the data from Weblogs.com, parses the XML, formats HTML to be returned, and returns the HTML to the inline frame.

You can put this inline frame any where.  I have it on my Home page so that I can watch the weblogs update while I am writing.  I have included the HTML snippet you need to include in your templates in a file called "webLogUpdates_html.txt" in the "myServices" directory in your "www" folder.

-- Begin inline frame. --

-- End inline frame. --

The Bigger Picture

This demonstration illustrates the ease with which your browser can turned into a real-time data receiver.  This demonstration uses a polling methodology to automatically refresh the data you see.  The other methodology widely used is an event driven publish-subscribe methodology.  Polling is passive, non-stateful, and requires little infrastructure other than what you have seen here.  An event driven publish-subscribe implementation requires an active, stateful connection between the subscriber and the publisher.  Most publish-subscribe implementation also include some type of intermediary in the form of a data router of some sort, whether that be an application server or a simple connection manager to act as a traffic cop.

Screenshots

For those of you who can't see the demo, below you will find a series of screenshot illustrating what is happening over a 90 second period.  Notice the changes in the list of weblogs and the time changes.  There is also a full-page screenshot here.



© Copyright 2003 Dann Sheridan Click here to send an email to the editor of this weblog.
Last update: 2/17/2003; 4:47:10 PM.

Click here to visit the Radio UserLand website.