say hi to "pewbot"!

I’ve knocked together a web service front end for our “people who borrowed this, borrowed that…” data.  For want of a better name, I’ve christened it “pewbot” (people who borrowed this).

To use the pewbot service, call it using a URL in the format:

http://webcat.hud.ac.uk:4128/pewbot/%5BISBN%5D

…where ISBN is a 10 digit ISBN (sorry – no ISBN 13 support just yet!)

There are 5 possible error messages that might get returned:

  • invalid ISBN
    the ISBN was not valid
  • ISBN not found
    the ISBN was not found on our catalogue
  • not enough data for ISBN
    the ISBN was found on our catalogue, but we don’t have enough circ data to generate any “borrowed that”s
  • time out
    the service timed out before it completed processing the request
  • database unavailable
    the backend database is unavailable

To see a sample error, try http://webcat.hud.ac.uk:4128/pewbot/garbage.

Assuming you don’t get an error, you’ll get a list of ISBNs and frequency counts in the following format:

<isbn count="[COUNT]">[ISBN]</isbn>

…where ISBN is a “borrowed that” item and COUNT is the number of borrowers who borrowed both that ISBN and the original ISBN that you sent to the web service.

For example, if you sent the ISBN 1234567890 and 10 of our borrowers had borrowed that book and also ISBN 9876543210, then you’d get something like this:

<?xml version="1.0" encoding="UTF-8" ?>
<isbnlist>
<isbn count="10">9876543210</isbn>
</isbnlist>

For a real life example, try Rethinking the Media Audience: The New Agenda (ISBN 0761950710).  At the time of writing, the top 4 most common “borrowed that” titles are various ISBNs for:

…for each one, 32 borrowers have borrowed both titles.

Some final notes:

  • the <isbnlist> items are sorted in descending frequency count
  • the lowest frequency count returned is 5
  • a maximum of 100 ISBNs will be returned in the <isbnlist>
  • data is generated from analysis of 2,150,346 circ transactions covering a period of 10 years
  • the most common “borrowed this, borrowed that” is for ISBNs 0702024481 (Health Promotion: Foundations for Practice) and 0702023086 (Promoting Health: A Practical Guide) – 287 borrowers have checked out both titles.
  • no personal data is returned by this service, nor is any personal data stored in the backend database used by the web service
Advertisements
11 comments
  1. Davey P said:

    I’ve also put together a page that will select a book at random (shown at the top left) and then display the most popular “also borrowed that” covers.

    http://webcat.hud.ac.uk:4128/modperl/relationships.pl

    You can click on any of the covers to view the most popular “also borrowed that” for that title.

    Or, if you’ve got an ISBN, you can plug that into the URL – for example, here’s Nielsen’s “Designing Web Usability”:

    http://webcat.hud.ac.uk:4128/modperl/relationships.pl?156205810X

    By the way, if you’re wondering what pewbot looks like, he looks an awful lot like medibot. In fact, whilst you’re looking at medibot, why not test your computing knowledge at the Look Around You quiz?

  2. Davey P said:

    I’ve now added caching to the code, and also improved the lookup speed by pre-loading a large chunk of the database into the server’s memory.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: