in reply to REST google search issues?

I tried to find a definitive answer for you, but no luck. Instead I went with the example in the pod for REST::Google. Here's the example:
#!/usr/bin/perl use strict; use warnings; use REST::Google; REST::Google->service('http://ajax.googleapis.com/ajax/services/search +/web'); REST::Google->http_referer('http://example.com'); my $res = REST::Google->new( q => 'perl regex', start => 4, ); die "response status failure" if $res->responseStatus != 200; my $data = $res->responseData; use Data::Dumper::Concise; warn Dumper ( $data );
OK. It gets a little tricky here. start => $start doesn't do anything except return an index of 0. So, I figured the problem was indeed the "start' value. As I understand it now, the start value is something like this:

0 = 0
1 = 4
2 = 8
3 = 12
4 = 16

As it stands, your start value is 0, so it returns 0. If you want the index for the 4th page, then

my $res = REST::Google->new( q = 'perl regex' start => 16, );
It will give you an index for the fourth page.

Replies are listed 'Best First'.
Re^2: REST google search issues?
by Anonymous Monk on Jan 07, 2010 at 14:58 UTC
    hmm, not sure I still understand and the documentation isn't that helpful. If I understand you correctly the cursor represents a hash table of page references? (e.g. 16 => page 4)

    Thanks for having a look at my code.

Re^2: REST google search issues?
by Anonymous Monk on Jan 07, 2010 at 15:00 UTC
    Another issue I have (don't understand) is that the param rsz => 'small', returns only 4 search results from the page and 'large' returns 8. How would I see all 10?

    Anyone?

      For the number of results pages, quoting the googledocs:

      Note: The maximum number of results pages is based on the type of searcher. Local search supports 4 pages (or a maximum of 32 total results) and the other searchers (Blog, Book, Image, News, Patent, Video, and Web) support 8 pages (for a maximum total of 64 results).