So the midnight oil has run out and the last for entries to MUTL looms, so here's a couple more scripts that didn't get as far as I wanted, but that do work, after a fashion...
The rationale for offering two scripts up together is that they demonstrate different potential uses for making use of a Greasemonkey script (or Firefox extension derived from a Greasemonkey script using a script2extension converter such as the Arantius Greasemonkey script compiler.
Here are the two scripts: book details form completion and OU Traveller (OU Traveller as a Firefox extension).
Book Details Form Completion
This script builds on the one described in the Lookup book Details script. The original intention was to augment a very basic form that allowed library users to request a book for purchase by the OU library.
The new script (which runs over this dummy book request form) will complete the form, given an ISBN. Clicking on the 'Get Book Details' link will also create two new links: one to allow the book to be looked up in the OU library catalogue according to title, and another to provide an author look up.
I toyed with the idea of loading a Carousel Widget: Similar Books into the page in an iframe (or using the JSON technique described in Wishlist Carousel to pull the related books info into the page a a list) but time has run out on me for now.
The Greasemonkey script shows how functionality for new services can be trialled without making changes to production systems. In a managed computer environment, such as public access library machines, new functionality can be evaluated on a sample of machines by real users if scripts are installed a selection of public access terminals.
Scripts can also be used to demonstrate mooted new functionality by running it over live production systems...
That the script creates catalogue lookup links when the 'Get book details' link is clicked on rather than installing them at page load time is just to demonstrate how logic/workflow can be built into the script. Ultimately, the aim would be to produce a 'request this book service' that checked the user's requests against books currently in the library, notifiying the user if the book is already held. In addition, the service might optionally look up related books - particulalry ones held by the library - to see if they would meet the user's needs.
Building the script also revealed several 'issues'.
The author lookup script, reused from another script submitted as an ,a href="./007292.html">earlier MUTL entry, identified 'issues' in framing author queries on the Voyager catalogue.
The ability to lookup several books with one call to the catalogue is also lacking - for example, it would be handy to be able to obtain a set of URLs (e.g. form xISBN or thingISBN) and pass them all in a single ISBN lookup query to the server, receiving a single result page listing the availability of all the books queried about in the catalogue (even better if the catalogue offered this option natively).
OU Traveller
The OU Traveller script represents the continued development of several OU Traveller components, though again it is not as fully developed as I had hoped, particularly in terms of visual design and integration with the Voyager Library Catalogue Toolbar.
The functionality offered by the OU Traveller script (which runs when an ISBN like number is found in a URL, as for example on Amazon) includes:
The look and feel of the panel still leaves something to be desired, as does the way the information is presented on it.
Also, at the current time, if several OU Traveller scripts are running, multiple panels may be created, although typically only one will be populated (withthe result that several scripts all arite results into the same panel). Observing this led me to realise that I should have created a standalone OU Traveller panel javascript library that can be loaded into OU Traveller scripts (or embedded in the OU Traveller Toolbar (forthcoming!)).
This library would check to see if a panel already exists (loaded by another script) before overlaying a panel on the page. If several OU Traveller scripts were loaded, they could all display results on the same OU Traveller panel.
The OU Traveller panel would thus in essence represent a 'widget environment' that could manage the displayed output from one or more OU Traveller scripts. In this way, different combinations of OU Traveller functionality could be assembled by loading different sets of OU Traveller scripts, yet all the reports would be displayed b the same, common interface panel.
If anyone is interested in working this idea up with me further, I would very much appreciate it :-)
As it is, each time I go in to the OU Traveller script, I try to abstract functionality out a little more, hopefully making individual components a little more reusable as I do so. However, a professional coder I am not, so the abstractions may be a little quirky at times and they are unlikely to fully exploit the power of good Javascript practice!
Perhaps more so than the book details lookup script, this script can be used by an individual in their own browser, although as with the other script it could also be preloaded on to public acces machines.
Posted by ajh59 at August 18, 2006 12:29 AM