III Bib # to ASIN to Cover Art

azImgSrc-1.0.tar.gz

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • blogmarks
  • co.mments
  • del.icio.us
  • De.lirio.us
  • digg
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • scuttle
  • Shadows
  • Simpy
  • TailRank
  • YahooMyWeb

I’ve written a PHP script that takes a III Bib # and, using amazon’s REST interface, it tries it’s darnedest to find the ASIN for that item. It will then store that Bib#-ASIN pair in a database. After that, it will cache the small, medium and large cover images associated with that ASIN in another database table and display whichever one you want.

This script requires the latest version of the III-XMLOPAC class (1.6), PEAR::DB, MySQL (of course) and PHP5 (or PHP4 with SimpleXML). In addition to that, you’ll need to have your own Amazon Dev token, etc.

Essentially, I wanted a way to get more cover art into the catalog. If you currently use Syndetics, you’ll know that you almost never get any cover art for CDs and DVDs. My solution was to write this. Just to warn you, though, this script will not return ASINs and cover art for all the items in your collection. Far from it. There is about a 30% hit-rate. I could easily get that higher, but then accuracy drops off, and I want 100% accuracy.

So, I plan on working with this script, massaging the search to figure out ways to get that 30% up. Please feel free to hack away at it yourselves too, but bear in mind, that I’m looking for accuracy above all else. If you’re really interested in how I’m determining an accurate hit, take a look at the code. Basically, I’m doing an initial search, then I match the UPC number on the amazon record to the stdnum info from the Bib record. Doing it this way, I haven’t seen a wrong match yet.

Incidentally, here is a hit list with images from this script:

To use it, you’d basically do something like this:

<?php
 
$bibnum = "123456";
echo  '<img src="/azImgSrc.php?bnum=' . $bibnum . '">';
 
?>

As a side bonus, you’ll have a nice table with Bib#-to-ASIN data. You can even manually add data to that table to ensure your favorite records have images associated with them.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • blogmarks
  • co.mments
  • del.icio.us
  • De.lirio.us
  • digg
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • scuttle
  • Shadows
  • Simpy
  • TailRank
  • YahooMyWeb

4 Comments so far
Leave a comment

I love it. I will point our ICT people to this, I would be lovely to get thi working…….

I had thought about doing this before but I was pretty sure it was against the terms. Are you refreshing your cache? From the terms:

You may store Amazon Properties generally (other than pricing or availability information) for caching purposes for up to 24 hours, however, you may store the following Amazon Properties for caching purposes for up to 1 month….

It also states that you have to link to Amazon in some fashion. I’d be interested if they make exceptions for libraries.

Also for many books isn’t the ASIN the same as the ISBN? You could probably use the xISBN service to try fetching until you get a result.

That’s a great point, and I forgot to mention that the images are timestamped so if you’re concerned about Amazon’s terms, you can use that field to wipe-out your cache after 24 hours, or whatever. I plan on making that a configurable option in the code (see TODO).

As far as linking to Amazon, you can be creative about that. Also, keep in mind, this is a proof-of-concept script.

Just wanted to point it out as some may grab the script without fully looking into all the terms.



Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(required)

(required)