List Info

Thread: note 78678 added to ref.xml




note 78678 added to ref.xml
user name
2007-10-22 22:59:04
I wanted to access the ISBN database, and was previously
parsing the HTML string generated from their main page, that
is until I discovered they have an API that returns XML.

So, if anyone wants to get some information from the ISBN
database, all you need to do is the following.

<?php
//Search the ISBN database for the book.
			$url = "http://www.isbnd
b.com/api/books.xml?
access_key=KEY&index1=isbn&value1=$_GET[ISBN]";

			$p = xml_parser_create();
			xml_parse_into_struct($p,file_get_contents($url),$results
,$index);
			xml_parser_free($p);

			$title = $results[$index[TITLELONG][0]][value];
			$author = $results[$index[AUTHORSTEXT][0]][value];
			$publisher = $results[$index[PUBLISHERTEXT][0]][value];
?>

You will need to get an access key from isbndb.com, but it
takes two seconds and is free. When you get it, replace KEY
in the URL with your own key. Also, my code above will
search for the book that fits the ISBN number stored in the
GET variable ISBN - you can search by other parameters and
return more than one result, but my example is  for a simple
ISBN search.
----
Server IP: 209.41.74.194
Probable Submitter: 206.208.133.75
----
Manual Page -- http://www.p
hp.net/manual/en/ref.xml.php
Edit        -- https://master
.php.net/note/edit/78678
Del: integrated  -- h
ttps://master.php.net/note/delete/78678/integrated
Del: useless     -- http
s://master.php.net/note/delete/78678/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/78678/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/78678/spam
Del: non-english -- 
https://master.php.net/note/delete/78678/non-english
Del: in docs     -- http
s://master.php.net/note/delete/78678/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78678
Reject      -- https://mast
er.php.net/note/reject/78678
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )