What is ROUTES?
ROUTES is a Library service providing access to selected quality-assessed
Internet resources for Open University courses. Resources are selected by
course teams and the Library's Information Specialists.
In addition to supporting searches through a web page, ROUTES can also provide responses to search queries in the form of an XML document. This allows other OU, as well as 3rd party sites, to make calls to ROUTES and display search results in their own pages.
The XML service can also be used to deliver search results into the page from which a search is made, using the Javascript xmlhttprequest function.
Search demo - try a course code, such as A221 or T396, or a subject area like science or technology. (NB you have to hit the search button to perform the search at the moment...)
The ROUTES-XML feed uses a bespoke XML document type to return results from the routes.open.ac.uk domain.
If you look at the source code of this page, you'll see how the browser-side bits are handled. A cross-platform (ish) function (makeRequest()) sets up the xmlhttprequest itself, and a second function (alertContents()) parses the returned RSS feed and appends it to a node in the current document.
As xmlhttprequest can only be made to the domain from which the page making the request was served, I have added an intermediary service (relay.php) that will parse RSS, ATOM and ROUTES-XML feeds from any domain when passed the relevant URL (passed to that script using the argument url), convert them to RSS (sort of), and re-syndiacte them...
Which means I can now display RSS feeds etc. within OUseful pages using xmlhttprequest :-)
PS here's a little demo embedding one of the Library's new book additions feeds into a page:
This uses a locally running version of feed2js to embed some javascript in the page that renders the feed...