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

Class: Services_Google

Source Location: /Services_Google-0.2.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 30]
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 38]

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 78]

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

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 95]

null __construct( string $key)

Constructor
  • Access: public

Parameters:

string   $key     The web services key provided by Google.

[ Top ]

current   [line 272]

void current( )

  • Access: public

[ Top ]

fetch   [line 148]

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 221]

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 ]

getResultsCount   [line 178]

int getResultsCount( )

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

[ Top ]

getSearchTime   [line 193]

float getSearchTime( )

Returns search time
  • Access: public

[ Top ]

key   [line 291]

void key( )

  • Access: public

[ Top ]

next   [line 281]

void next( )

  • Access: public

[ Top ]

rewind   [line 286]

void rewind( )

  • Access: public

[ Top ]

search   [line 130]

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 ]

setOptions   [line 107]

void setOptions( array $options)

Set Query options
  • Access: public

Parameters:

array   $options     An array of options

[ Top ]

spellingSuggestion   [line 209]

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 249]

void valid( )

  • Access: public

[ Top ]


Documentation generated on Sun, 23 Mar 2008 04:30:04 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.