-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
byIsbn method sometimes return null #6
Comments
I believe when you loop through this, you'll need to check if it is not null before displaying it since you obviously can't echo null |
The point is, if i remove 'isbn:' works fine, i can find the books. But if i restore that string, null is the result. |
Can you post your code? |
Sure, i simply make a call to findByGoogleBooks:
Maybe i need to call search instead of byisbn |
that method only takes the ISBN. https://github.com/scriptotek/php-google-books/blob/master/src/Volumes.php#L41 I believe what you are saying is you are doing something like:
it should just be the isbn
since we prepend that isbn string. check the link to the |
@josephmancuso i know, but with prefix 'isbn:' i have always null or empty data, returned from api. But in reality the books exists if i test the call with postman. |
ahhh ok I see. So removing the 'isbn:' from the volumes class fixes the issue you're saying? |
@josephmancuso yep, maybe something is changed on google books api. But I could not understand why it did not work anymore, and to test it, i've tried to remove 'isbn:'. |
hm it looks like the 'isbn:' still works via the google books api.
I'll test the actual code some time today. There are two PRs open that significantly change the API for this repo but a hot fix can work for the master branch. @danmichaelo is the owner if you want to open a PR for the master branch go ahead. I'll test today. |
With italian isbn doesn't works yet, like 9788807902246 |
Well ISBN are international. That's what the I stands for. They're either 13 digits or 10 digits. I'll test both |
Of course, then maybe it's google books that has not added all the titles in the world in its archive? :D |
Hm, this is quite interesting. If you look at the response for 9788807902246, it seems to refer to another book. Here's an excerpt: {
"title": "Paddy Clarke ha ha ha",
"authors": [
"Roddy Doyle"
],
"publishedDate": "1996",
"industryIdentifiers": [
{
"type": "ISBN_10",
"identifier": "8202160278"
},
{
"type": "ISBN_13",
"identifier": "9788202160272"
}
], At first I though it was the same book with another ISBN, but when I googled the same ISBN, I found the book Sull'Apocalisse. Testo latino a fronte by di Gioacchino da Fiore (2018) – a very different book. So it seems like the Google Books API can return information about the wrong item if you just do a free query without the |
@danmichaelo what was the exact query you put in? I actually noticed a discrepancy if there was a space between isbn: and the number. No space returned 1 result and a space returned like 1600 results |
@danmichaelo Sure, give me a few minutes to make a list of problematic isbn. here we go: 9788845426544 |
The query can be found in the link I added ;) No key is needed. But the strange part is that I get a different (and seemingly correct) result now! Could it just have been a temporary problem at Google? For 9788845426544 and 9788811689188 I get zero results both with and without the |
HI,
i notice that sometime, the byIsbn method from Voumes class, return null. But from google books api console, i see the results. So i need to delete the string 'isbn' and now work fine. Any suggestions ?
The text was updated successfully, but these errors were encountered: