GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::GOOGLE::RESPONSE (3)

.ds Aq ’

NAME

Net::Google::Response - simple OOP-ish interface to the Google SOAP API search responses

CONTENTS

SYNOPSIS



 my $service = Net::Google->new(key=>LOCAL_GOOGLE_KEY);
 my $session = $service->search();

 $session->query(qw(Perl modules));

 # You are probably better off calling
 # $session->results() but if you want
 # the raw response object(s) here ya go :

 my $responses = $session->response();
 my $count     = scalar(@$responses);

 # $r is a Net::Google::Response object

 foreach my $r (@$responses) {
     print sprintf("%s : %s\n",$r->searchQuery(),$r->estimatedTotalResults());
 }



DESCRIPTION

Provides a simple OOP-ish interface to the Google SOAP API for searching. This package is used by Net::Google.

The Net::Google::Response object is used to contain response information provided by the Google search service in response to a search query. The Response object allows the client program to easily access the data returned from a search.

Response data is accessed using methods with identical names to the elements of a search response (as documented in the Google Web APIs Reference, section 3). For instance, the first example in the SYNOPSIS section, above, would return the estimated number of total results for the query.

Response objects may contain other response objects, where an element would return an array of other elements. For instance, calling $response->resultElements() will return a reference to an array of Net::Google::Response objects, each one representing one result from the search.

The Response module will automatically provide methods for the search response, as described by the service WSDL file. The results format is described by the Google APIs documentation, to which you should refer for the most up-to-date information. As of the April 8th, 2002 release of the Google APIs, the methods below are provided for each search result.

PACKAGE METHODS

    __PACKAGE__->new(\%args)

Net::Google::Response OBJECT METHODS

CW$response->documentFiltering()

Returns 0 if false, 1 if true.

CW$response->searchComments()

Returns a string.

CW$response->estimatedTotalResultsCount()

Returns an integer.

CW$response->estimateIsExact()

Returns 0 if false, 1 if true.

CW$response->resultElements()

Returns a reference to an array of Response objects.

CW$response->searchQuery()

Returns a string.

CW$response->startIndex()

Returns an integer.

CW$response->endIndex()

Returns an integer.

CW$response->searchTips()

Returns a string.

CW$response->directoryCategories()

Returns a reference to an array of Response objects (one per directory category — see below).

CW$response->searchTime()

Returns a float.

CW$pkg->to_string()

Result OBJECT METHODS

CW$result->title()

Returns a string.

CW$result->URL()

Returns a string.

CW$result->snippet()

Returns a string, formatted in HTML.

CW$result->cachedSize()

Returns a string.

CW$result->directoryTitle()

Returns a string.

CW$result->summary()

Returns a string.

CW$result->hostName()

Returns a string.

CW$result->directoryCategory()

Returns a hash reference.

VERSION

1.0

DATE

$Date: 2006/01/12 03:37:31 $

AUTHOR

Aaron Straup Cope

CONTRIBUTORS

Marc Hedlund <marc@precipice.org>

SEE ALSO

Net::Google

LICENSE

Copyright (c) 2002-2005, Aaron Straup Cope. All Rights Reserved.

This is free software, you may use it and distribute it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::GOOGLE::RESPONSE (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.