Skip Menu |
 

This queue is for tickets about the WWW-Scraper-ISBN-GoogleBooks_Driver CPAN distribution.

Report information
The Basics
Id: 93222
Status: new
Priority: 0/
Queue: WWW-Scraper-ISBN-GoogleBooks_Driver

People
Owner: Nobody in particular
Requestors: lyon.lemmens [...] redlemon.nl
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: GoogleBooks ISBN Scraper fail test (+solution)
Date: Fri, 21 Feb 2014 11:50:20 +0100
To: bug-WWW-Scraper-ISBN-GoogleBooks_Driver [...] rt.cpan.org
From: Lyon Lemmens <lyon.lemmens [...] redlemon.nl>
Download (untitled) / with headers
text/plain 1.1k
LS, I've been playing around with the excellent ISBN scrapers. But I couldn't get the GoogleBooks one to install as it failed the tests, not capturing the number of pages correctly. With a bit of digging I found that google books redirected me to the dutch site google.books.nl. Which your code captured and adapted the language for correctly. But for some reason it didn't capture the length of the book. Looking at the source of the HTML page, I could not see directly what was wrong. However I did notice that there is a flag in the URL that tells you if a redirect has taken place (redir_esc=y). Setting this flag to 'n' in the first place prevented the redirection completely. This means that by setting this flag, you would always go to the main site and you wouldn't need to jump through the language hoops. That would probably simplify the code a bit. Anyway, for now I made one change to the code: 124c124 < $data->{url} = $code->{'ISBN:'.$isbn}{info_url}; --- Show quoted text
> $data->{url} = $code->{'ISBN:'.$isbn}{info_url} . '&redir_esc=n';
This makes it always use the main site and all tests now run OK. -- Regards Lyon Lemmens


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.