.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Net::Google::Search 3" .TH Net::Google::Search 3 "2008-01-01" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Net::Google::Search \- simple OOP\-ish interface to the Google SOAP API for searching .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Net::Google::Search; \& my $search = Net::Google::Search->new(\e%args); .Ve .PP .Vb 2 \& $search->query(qw(aaron cope)); \& map { print $_->title()."\en"; } @{$search->results()}; .Ve .PP .Vb 1 \& # or .Ve .PP .Vb 2 \& foreach my $r (@{$search->response()}) { \& print "Search time :".$r->searchTime()."\en"; .Ve .PP .Vb 4 \& # returns an array ref of Result objects \& # the same as the $search->results() method \& map { print $_->URL()."\en"; } @{$r->resultElement()} \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Provides a simple OOP-ish interface to the Google \s-1SOAP\s0 \s-1API\s0 for searching. .PP This package is used by \fINet::Google\fR. .SH "ENCODING" .IX Header "ENCODING" According to the Google \s-1API\s0 docs : .PP .Vb 6 \& "In order to support searching documents in multiple languages \& and character encodings the Google Web APIs perform all requests \& and responses in the UTF-8 encoding. The parameters and \& are required in client requests but their values are ignored. \& Clients should encode all request data in UTF-8 and should expect \& results to be in UTF-8." .Ve .PP (This package takes care of setting both parameters in requests.) .SH "PACKAGE METHODS" .IX Header "PACKAGE METHODS" .Sh "_\|_PACKAGE_\|_\->new(\e%args)" .IX Subsection "__PACKAGE__->new(%args)" Valid arguments are : .IP "\(bu" 4 \&\fBkey\fR .Sp \&\fIstring\fR. A Google \s-1API\s0 key. .Sp If none is provided then the key passed to the parent \fINet::Google\fR object will be used. .IP "\(bu" 4 \&\fBstarts_at\fR .Sp \&\fIint\fR. First result number to display. .Sp Default is 0. .IP "\(bu" 4 \&\fBmax_results\fR .Sp \&\fIint\fR. Number of results to return. .Sp Default is 10. .IP "\(bu" 4 \&\fBlr\fR .Sp \&\fIstring\fR or \fIarray reference\fR. Language restrictions. .IP "\(bu" 4 \&\fBsafe\fR .Sp \&\fIboolean\fR. .IP "\(bu" 4 \&\fBfilter\fR .Sp \&\fIboolean\fR. .IP "\(bu" 4 \&\fBhttp_proxy\fR .Sp \&\fIurl\fR. A \s-1URL\s0 for proxy-ing \s-1HTTP\s0 requests. .IP "\(bu" 4 \&\fBdebug\fR .Sp Valid options are: .RS 4 .IP "\(bu" 4 \&\fIboolean\fR .Sp If true prints debugging information returned by SOAP::Lite to \s-1STDERR\s0 .IP "\(bu" 4 \&\fIcoderef\fR. .Sp Your own subroutine for munging the debugging information returned by SOAP::Lite. .RE .RS 4 .RE .PP The object constructor in Net::Google 0.53, and earlier, expected a \fIGoogleSearchService\fR object as its first argument followed by a hash reference of argument. Versions 0.6 and higher are backwards compatible. .PP Returns an object. Woot! .SH "OBJECT METHODS" .IX Header "OBJECT METHODS" .Sh "$obj\->key($string)" .IX Subsection "$obj->key($string)" Get/set the Google \s-1API\s0 key for this object. .Sh "$obj\->http_proxy($url)" .IX Subsection "$obj->http_proxy($url)" Get/set the \s-1HTTP\s0 proxy for this object. .PP Returns a string. .Sh "$obj\->query(@data)" .IX Subsection "$obj->query(@data)" If the first item in \fI@data\fR is empty, then any existing \&\fIquery\fR data will be removed before the new data is added. .PP Returns a string of words separated by white space. Returns undef if there was an error. .Sh "$obj\->starts_at($at)" .IX Subsection "$obj->starts_at($at)" Returns an int. Default is 0. .PP Returns undef if there was an error. .Sh "$obj\->max_results($max)" .IX Subsection "$obj->max_results($max)" The default set by Google is 10 results. However, if you pass a number greater than 10 the \fIresults\fR method will make multiple calls to Google \s-1API\s0. .PP Returns an int. .PP Returns undef if there was an error. .Sh "$obj\->restrict(@types)" .IX Subsection "$obj->restrict(@types)" If the first item in \fI@types\fR is empty, then any existing \&\fIrestrict\fR data will be removed before the new data is added. .PP Returns a string. Returns undef if there was an error. .Sh "$obj\->filter($bool)" .IX Subsection "$obj->filter($bool)" Returns true or false. Returns undef if there was an error. .Sh "$obj\->safe($bool)" .IX Subsection "$obj->safe($bool)" Returns true or false. Returns undef if there was an error. .Sh "$obj\->lr(@lang)" .IX Subsection "$obj->lr(@lang)" Language restriction. .PP If the first item in \fI@lang\fR is empty, then any existing \&\fIlr\fR data will be removed before the new data is added. .PP Returns a string. Returns undef if there was an error. .Sh "$obj\->return_estimatedTotal($bool)" .IX Subsection "$obj->return_estimatedTotal($bool)" Toggle whether or not to return all the results defined by the \&'_\|_estimatedTotalResultsCount' key. .PP Default is false. .Sh "$obj\->\fIresponse()\fP" .IX Subsection "$obj->response()" Returns an array ref of \fINet::Google::Response\fR objects, from which the search response metadata as well as the search results may be obtained. .PP Use this method if you would like to receive a full response as documented in the Google Web APIs Reference (the whole of section 3). .Sh "$obj\->\fIresults()\fP" .IX Subsection "$obj->results()" Returns an array ref of \fIResult\fR objects (see docs for \&\fINet::Google::Response\fR), each of which represents one result from the search. .PP Use this method if you don't care about the search response metadata, and only care about the resources that are found by the search, as described in section 3.2 of the Google Web APIs Reference. .Sh "$obj\->\fIqueries_exhausted()\fP" .IX Subsection "$obj->queries_exhausted()" Returns true or false depending on whether or not the current in-memory \&\fBsession\fR has exhausted the Google \s-1API\s0 1000 query limit. .SH "VERSION" .IX Header "VERSION" 1.0 .SH "DATE" .IX Header "DATE" $Date: 2006/01/12 03:37:31 $ .SH "AUTHOR" .IX Header "AUTHOR" Aaron Straup Cope .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" Marc Hedlund .SH "TO DO" .IX Header "TO DO" .IP "\(bu" 4 Add hooks to manage boolean searches and speacial query strings. .SH "SEE ALSO" .IX Header "SEE ALSO" Net::Google .SH "LICENSE" .IX Header "LICENSE" Copyright (c) 2002\-2005, Aaron Straup Cope. All Rights Reserved. .PP This is free software, you may use it and distribute it under the same terms as Perl itself.