Skip Menu |

This queue is for tickets about the Net-Google CPAN distribution.

Report information
The Basics
Id: 1618
Status: resolved
Priority: 0/
Queue: Net-Google

People
Owner: Nobody in particular
Requestors: BJOERN [...] cpan.org
Cc:
AdminCc:

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



Subject: response() does not stop requesting
Net::Google::Search::response() fails to stop requesting Google if all results have been retrieved if the number of results is divisible by ten. It will only stop when max_results is reached. Google always returns the last ten results, even if the value of <start> is higher then the total number of results, hence the results are not only requested, but also erroneously added to the result set, causing a lot of duplicate results. This can be fixed by adding ... my $res = $self->_response($start_at,$count) || next; last if $start_at >= $res->{__endIndex}; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It will still request one superfluous result set, but that cannot be fixed in this package (IMHO).
Fixed in version 0.51, which is now on its way to the CPAN - thanks for the heads up. [BJOERN - Sat Oct 5 13:20:30 2002]: Show quoted text
> Net::Google::Search::response() fails to stop requesting Google if all > results have been retrieved if the number of results is divisible > by ten. It will only stop when max_results is reached. Google > always returns the last ten results, even if the value of <start> > is higher then the total number of results, hence the results are > not only requested, but also erroneously added to the result set, > causing a lot of duplicate results. > > This can be fixed by adding > > ... > my $res = $self->_response($start_at,$count) || next; > last if $start_at >= $res->{__endIndex}; > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > It will still request one superfluous result set, but that cannot be > fixed in this package (IMHO).