Just another Nodetraveller

Icon

Another blog about someone playing about with web development

Introducing LiveInfo..

Directly evolved from liveSearch, is a updated version which I’m calling liveInfo. As can be seen at chregu’s blog LiveSearch displays live search results while a user enters the search text. You’ve probably seen Google Suggest which uses the same technology (XMLHTTPRequest).

One of the coolest things about liveSearch is the keyboard navigation where users, when the input field has the focus, the user can navigate through the results using the up and down keys on the keyboard. Because of the pageSet script I’ve done in the past I initally implemented paging functionality into the original liveSearch script including navigating through the pages with the left and right arrow keys.

I then thought about making it easier to implement something like this on various blogging and CMS systems. This led me to using XML to load config data. As a result, liveInfo has a skinnable, plug-in architecture and as its completely object oriented, more than one liveInfo element can be used on a page. The small PHP framework fully supports XMLRPC (using incutio’ XMLRPC library) and SOAP (using nusoap )webservices and should be easily portable to other languages for use in CMS or blogging systems written in that language.

I’ve also enabled it to work with opera 7+ as well as IE 5+ and Gecko based browsers. It should also work on Safari and other browsers though I haven’t been able to test this. Please report any problems and I’ll try and fix it. For browsers that support it, it uses document.importNode to display the data so it should also work on those documents that are true XHTML documents.

You can see it running on this blog. The wordpress search liveInfo element is a simple database based system, while the SynTV Search Listings LiveInfo element is a XMLRPC based service which retrieves search result from SynTV. The download comes with a demo page which also includes a Google the search element which uses Google SOAP API.

The complete feature set can be seen in the following list.

  • Support for more browsers
    • Internet Explorer 5+ (Win)
    • Gecko based browsers
    • Opera 7+
    • Should work with IE Mac, Konqueror etc. Needs testing
  • Multiple LiveInfo elements on one page
  • Pageable results (Keyboard navigation via left, right, up and down keys)
  • Support for forms with multiple elements
  • Cacheable Results
  • Dynamic forms
  • Skinnable Results
  • Plugin support (services)
  • Webservices support (via plugins)

I’ve also put up a page describing how liveInfo works but in short all a plugin writer has to do is write a class extending the liveInfo class or subclass and implement two methods. Then write an XML file denoting config values, cache time, form HTML and results HTML . If needed, the writer can provide a css file too. All the user has to do is extract the plugin into the plugins directory and add a few lines in their page.

Technorati Tags: | |

UK TV Listings via XMLRPC

The UK TV Guide for Mambo component is basically a XML RPC client thats talks to the XML RPC server here at nodetraveller.com and renders the data it gets back in a nice way. The component has been released for a few weeks now and I’ve actually been using the service for a long time before that too so its probably a good time to let people know how to access it….

Because the UK TV Listings webservice is implemented using XML RPC it means anyone can access it via a XML RPC client. Read the rest of this entry »

UK TV Guide Component

I’ve just completed a component for Mambo. As you can probably guess by the name, it retreives and displays the TV and Radio listings for the UK. At the moment, there is a choice of over 60 channels and two ways of displaying the listings; columns and timeline.

I spent a bit more time on the UI than normal but finally I’m pleased with it. It works using XML RPC, connecting to my service and then displaying the listings. I hope to post more about the XML RPC service soon but I need to finish off a project before I do…

Anyway, click the link in the menu and take a look. You can also download the component here from this site or from mamboforge.

Flash TvGuide App

Okay, heres the flash client (only 47k!) for the TVguide webservice posted recently.

It’s quite a fairly simple movie using flash remoting and amfphp. I used amf to call my tvguide webservice via SOAP. Instead of having your swf call a specifc flash service, you call a special service which acts like a proxy to SOAP webservices. This service looks like this..

< ?php
// AMFPHP uses by default the PEAR::SOAP
// library, so you need to define in the
// gateway not to use that. In this case
// NuSOAP will be used

// change this based on your amfphp installation
include_once($_SERVER['DOCUMENT_ROOT'] . ‘/flashservices/app/Gateway.php’);
$gateway = new Gateway();
$gateway->usePearSOAP(false);
$gateway->service();
?>

You connect to this via NetServices..

this.netConn = NetServices.createGatewayConnection(”http://www.nodetraveller.com/flashservices/services/WSProxy.php”);

Then you specify the webservice you want by providing the endpoint to the getService method..

this.service = this.netConn.getService(”http://www.nodetraveller.com/webservices/tvGuide/tvGuideService.php?wsdl”,this);

and then call the webservice method you want…

this.service.getChannels(paramsObj);

The paramsObj is a value object holding any parameters the webservice method expects. When the data comes back you handle it the normal way..

Oh, and I had lots of fun playing about with the datagrid and creating a custom cell for it for the channel logo graphics.

Based on the Model View Architecture which works basically like this for those of you who don’t know yet:
The Model is an object that handles the remoting stuff and nothing else. It just connects to remote services and handles the data when it comes in. When the data does come in, it fires of an event to the View. The View is a listener of the Model so when the Model shouts, the View jumps. Now when the user interacts with the app, its the Controller that decides what to do; call a method on the Model or the View. Nice and easy…MVC ain’t completely perfect but its very useful…

You can see the actionscript files for the Model, View or Controller or download here

UK TV Guide Webservice

Recently I’ve been working on a webservice using PHP and nusoap. It provides information about 41 UK TV and radio programming schedule for the upcoming week.

The wsdl can be found here and example php client here.

I’m just finishing the final touches to a flash client which I’ll be posting sometime within the next couple days. Hopefully this will show how to use the webservice in your flash apps..