More fun with Dynix OPAC, PHP and XML

Remember four years ago when I did some experiments with my local library’s online catalog? While I’ve returned to the project, and have released some updated code that leverages the fact that Dynix, the engine behind the catalog, can output XML for almost everything it does. The result is a PHP class: class.dynix.php.

You can try this out for yourself, if you’re a PEI Provincial Library card holder, by visiting this example page wherein you can enter your public library card number and password and retrieve a nicely formatted list of the items you have checked out and on hold. Here’s what it looks like in action:

Entering OPAC URL, username and password screen shot Nicely formatted list of the items I have checked out and on hold

Note that although I don’t record your library card number and password, they are sent insecurely, and as such are liable to interception by evil doers. Of course this is also true when you use the OPAC directly, albeit with one fewer point of possible evil.

In theory this should work for any Dynix system that has a website: the default URL in the example above is for Prince Edward Island, but if you can find the equivalent URL for your system, just enter it (it might end in ipac.jsp like ours does?).

For maximum fun, go and grab the PHP source code and set yourself up locally: all you need is a standard PHP5 install — there are no other dependencies.


Paul R. Pival's picture
Paul R. Pival on February 27, 2008 - 05:55 Permalink

Hey Peter, neat stuff — I’ll try it with my local Dynix system when I find my wallet :-) Have you ever played with Library Elf? Seems to do pretty much the same thing — while PEI isn’t on The List (I just requested it), I know they support Dynix systems.

Paul R. Pival's picture
Paul R. Pival on February 27, 2008 - 05:57 Permalink

Whoops, my bad, PEI Provincial IS on the list already — I was looking for PEI Public :-/

Ryan's picture
Ryan on February 27, 2008 - 21:33 Permalink

Way to go Peter! It’d be neat to development this into typical module for your favorite CMS (eg. Joomla, Drupal, Wordpress). Eg. (What am I borrowing now?)

Although it’d be nice to get some encryption into the class though too.

Peter Rukavina's picture
Peter Rukavina on February 27, 2008 - 21:44 Permalink

What would be really helpful is some sort of mechanism, similar to the Flickr Authentication API, what would allow a patron to provide access to a given set of personal library data without handing over their library card number and password.

I wonder if such a thing exists for Dynix.

Peter Rukavina's picture
Peter Rukavina on February 27, 2008 - 21:50 Permalink

To continue the conversation with myself: it seems there is a concept called “Remote Patron Authentication” that comes close to this in concept. Except that the idea with RPA is simply to allow patrons to authenticate against the OPAC and then gain access to third-party data, whereas what I’m looking for is a way to allow patrons to authenticate against the OPAC and then allow my third-party application access to some of their OPAC data.

Oh, and it seems maybe when I say “OPAC” I should be saying “ILS.” At least if I want to be hip to the librarian lingo.

Ryan's picture
Ryan on February 27, 2008 - 21:58 Permalink

Just mulling over the code. Couple of things for a coder to consider:

1. Curl support for people on hosted webservers.
2. Possible to retrieve data via XMLReader to save on load time? There’s a lot of extraneous xml in those urls. Not a biggy if you are only grabbing one thing, but if you were to get multiple things from different places (your holds + your kids’ holds), the time savings could be significant.
3. Some encryption help would be nice, of course.

You might want to add a little extra to your comments as well about privacy etc. too. Although you are covered via “no warrantees” there could still be the risk of someone borrowing a book on (eg.) How to divorce your husband and that appearing on a blog/website etc.

I’ll play with it a bit and see what I can add to help out with some of these things.

Glenn Peterson's picture
Glenn Peterson on March 13, 2008 - 19:16 Permalink

Hennepin County Library offers a limited amount of information from a users account — folks can retrieve their items out and items on hold via RSS. The syntax looks something like:…

(this is a live test account used for training)

The RandomKey is associated in the ILS database with the user, but only person’s first name and last initial is published in the feed for privacy. Only authenticated users can get access to their key, of course, and choose whether and how to share publicly. We are a Sirsi/Dynix library running Horizon ILS.

Patrick's picture
Patrick on September 29, 2009 - 00:11 Permalink

This is something I’m really interested in doing, and I was wondering if you could give me a few pointers. The links to the source code are dead and I’m not having any luck digging up info on the Dynix API. Is there any good documentation for this available?

Thanks for your help,

—- Patrick

DaveMcL's picture
DaveMcL on March 3, 2010 - 17:25 Permalink

Peter, I’m really liking what’s going on here. Any chance you would release the source code of the page(s) you use to access your class?

Chris's picture
Chris on November 30, 2010 - 21:40 Permalink

I’m in the same boat with Patrick, if it would be possible to get the source code I’d really appreciate it. Thanks. ~ Chris