Attending Code4Lib North - Hackfest

So I'm in Hamilton, ON attending code4lib North today and tomorrow. The conference is relatively small but in some respects (less than 50 people) but perfect for having a good hackfest. I've gotten to talk to 5 people about OCLC web services. Several are interested in name authority information or sharing non authority name information between libraries, particularly libraries working on digital collections. So I pointed out VIAF and WorldCat Identities as possible sources of name information.

My hackfest project evolved from my recent work and interest in the Zend framework. I've been using Zend to help me access a couple web services in the last few months. In particular the Amazon class has made working with the the Amazon Advertising API much simpler. I've also used it to easily build RSS and Atom feeds based on data from other APIs. Working with Zend got me thinking, what would it be like if there were Zend classes that worked with the various OCLC web services? So I started thinking about how one might do that.

At first the task seemed really daunting, because I'm unfamilar with object oriented programming and I've never written or extended a PHP class before. However, I found that the Feed_Reader Class in Zend was really close to what I needed. However, it needed to be modified in a couple ways

  • I wanted it to have the based url for searching WorldCat Search API via OpenSearch preset
  • I needed to be able to send it several parameters: the keyword search, the format, the wskey, number of records to retrieve and the start index

Luckily for me I got some help at the hackfest. Matt from McMaster University helped me to understand how to extend a class in PHP and actually helped write the first version. Ironically, for all of my worry the code to extend the class turned out to be only 9 lines long. I'm pretty excited about it because it allows me to access all the goodness of the Zend_Feed_Reader class and avoid having to know too much about how to construct a url to interact with WorldCat Search API to do a simple OpenSearch.

I'm hoping that this will be the first of several Zend class extensions and Zend classes I write but only time will tell.

  • Karen Coombs

    Karen Coombs

    Senior Product Analyst