Services_Google
[ class tree: Services_Google ] [ index: Services_Google ] [ all elements ]

Class: Services_Google

Source Location: /Services_Google-0.1.0/Google.php

Class Overview


A PHP implementation of the Google Web API (http://www.google.com/apis/)


Author(s):

Copyright:

  • Jon Wood, 2004

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 29]
A PHP implementation of the Google Web API (http://www.google.com/apis/)

To use this package you will need to register for a search key.



[ Top ]


Class Variables

$key =

[line 36]

The key to use for queries.
  • Access: public

Type:   string


[ Top ]

$queryOptions = array("start" => 0,
                                 "maxResults" => 10,
                                 "limit" => false,
                                 "filter" => true,
                                 "restricts" => "",
                                 "safeSearch" => true,
                                 "language" => "")

[line 71]

An array of options to be applied to queries.
  • Access: public

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 86]

null __construct( string $key)

Constructor
  • Access: public

Parameters:

string   $key   —  The web services key provided by Google.

[ Top ]

current   [line 225]

void current( )

  • Access: public

[ Top ]

fetch   [line 122]

GoogleSearchResult|false fetch( )

Fetch results from a search.

This method will return a GoogleSearchResult object, or false if no results were found, or the limit has been reached.


[ Top ]

getCachedPage   [line 180]

string getCachedPage( string $url)

Gets a cached page from Google's cache.
  • Return: The cached page.
  • Access: public

Parameters:

string   $url   —  The page to get.

[ Top ]

key   [line 244]

void key( )

  • Access: public

[ Top ]

next   [line 234]

void next( )

  • Access: public

[ Top ]

numResults   [line 152]

int numResults( )

Returns the number of results for the current query.
  • Access: public

[ Top ]

rewind   [line 239]

void rewind( )

  • Access: public

[ Top ]

search   [line 104]

null search( string $query)

Setup up a search to be run.

Once you've run this method, you need to call fetch() to get results. You can set search options with the queryOptions variable.


Parameters:

string   $query   —  The query string to use.

[ Top ]

spellingSuggestion   [line 168]

string spellingSuggestion( string $phrase)

Does a spell check using Google's spell checking engine.
  • Return: A suggestion of how the phrase should be spelt.
  • Access: public

Parameters:

string   $phrase   —  The string to spell check.

[ Top ]

valid   [line 206]

void valid( )

  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:54:07 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.