Getting Alternate ISBNs
I’ve added the following function to the version of the XMLOPAC class I use internally so that I can get alternate ISBNs using OCLC’s xISBN service.
public function get_altisbn($isbn) {
$xmlopacurl = 'http://labs.oclc.org/xisbn/' . $isbn;
$xml = self::prep_xml($xmlopacurl);
$result = array();
foreach ($xml->xpath('/idlist/isbn') as $temp) {
$result[] = (string) $temp;
}
// the first element of the array is always the same as
// the query ISBN, array_shift deletes it from the array
array_shift($result);
return($result);
}
I then call it from within the get_opac_data()
function like this:
$result[altisbn] = self::get_altisbn($result[isbn]);
The result, of course, is an array of ISBNs that serves all sorts of meaningful purposes, like finding an ASIN when you don’t find a match for the cataloged ISBN.
Technorati Tags: isbn, library, libraries, oclc, php, web service, xml, xmlopac, xmlopac class
December 7th, 2005 at 7:27 pm
Link-addressible artifacts
I mentioned the other day that a part of the value of Flickr was that it made images citable, or, in the term suggested by John Udell in a nice post about media, ‘link-addressible’. John’s last sentence below (my emphasis) is a nice statement of the…
December 8th, 2005 at 12:35 am
III-XMLOPAC class update 1.6
iii-xmlopac-1.6.tar.gz
…
December 8th, 2005 at 12:48 am
[...] I really love that Casey keeps adding functionality to the III XMLOPAC class. I’ve incorporated his latest function that grabs alternate ISBN numbers from OCLC’s xISBN service into 1.6. [...]