Jump to:
| Project: | Create from Web |
| Version: | 6.x-1.3 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed |
Issue Summary
I'm trying to use this module to retrieve information on various books (via the ISBNdb.com service) and map it to CCK fields, but I'm having a few problems.
First of all, entering the book's ISBN as the search criteria invariably brings back no results, even when the ISBN is copied directly from the page for that book on the ISBNdb web site itself. It simply won't search by ISBN, which I had thought was the whole point of that service. The only way to find a book is to type the full author and title into the search box - and then once you do that, the only info it returns is the title, author, ISBN and publisher (half of which I'd already just had to type in anyway, and might as well have just typed directly into the Create Content form).
If you look at the pages on the ISBNdb.com site, they have a lot more info than just that - they have a summary, classification, and a "book details" section that includes year of publication and page count, all of which would be useful to have. But none of that comes back via this module.
Is this just a matter of what's included in the .inc file for the service - could I modify that to have it retrieve more of the info? Or is there some reason why it can't be made to get more than that?
Comments
#1
OK, a little further experimentation answered part of the question for me: I can indeed extract more info from it by modifying the operator_isbndb.inc file. Changing "results=details" to "results=details,texts" in the URL, and then adding addition lines to the array - example:
"summary" => utf8_decode((string)$bookdata->Summary),- enabled me to access some of the data in the "texts" area of the response (I read up on a bit at http://isbndb.com/docs/api/51-books.html).
But I'm still having problems with some of it. Specifically, anything that returns multiple values, like the Subjects and Details fields in the response. The code that constructs the results array in the .inc file treats everything as a string, but I think these are probably arrays. By way of example, what the sample they show in the API documentation shows for the Details field is:
<Details dewey_decimal="302.2/3"dewey_decimal_normalized="302.23"
lcc_number="PN4888"
language="eng"
physical_description_text="x, 127 p. ; 22 cm."
edition_info=""
change_time="2004-10-19T23:52:56"
price_time="2005-07-29T02:06:41" />
Now, I've sorted out that I can extract one value from that by formatting the corresponding line in the array as:
"physical_desc" => utf8_decode((string)$bookdata->Details['physical_description_text']),But I'm still not sure how to get the data from fields like Subjects, where there could be a varying number of them listed in the array... Any ideas?
#2
at the moment there is no support for multiple value attributes of web services. you'd have to work around that, e.g. by concatenating (or serialize into json) the multiple values in the operator.inc and then do some cck magic to split it again ... sorry.