Proposal for "Services_Google"

» Metadata » Status
  • Category: Web Services
  • Proposer: Jon Wood 
  • License: PHP
» Description

I have developed a package which allows easy access to Google's web API.

Using the spell checker and cache is as simple as creating a new object, and calling the method, which will then return either a spelling suggestion, or the requested cached page.

The class supports the Iterator interface, so results can be retrieved by using a foreach loop, as shown below.
<php>
$google->search("PEAR");
foreach($google as $key => $result) {
echo $key."\t".$result->title."\n";
}

</php>

Links

Package Source: http://www.jellybob.co.uk/~jon/pear/Services_Google.phps
Example: http://www.jellybob.co.uk/~jon/pear/Services_Google_Example.php
Example Source: http://www.jellybob.co.uk/~jon/pear/Services_Google_Example.phps

» Dependencies » Links
  • PHP 5.0.0
» Timeline » Changelog
  • First Draft: 2004-07-18
  • Proposal: 2004-07-18
  • Call for Votes: 2004-07-26
  • Jon Wood
    [2004-07-18 19:19 UTC]

    Modified the code to allow removing the foreach inside the while loop.

  • Jon Wood
    [2004-07-18 19:25 UTC]

    ->numResults() is now supported, and added to the source online.

  • Jon Wood
    [2004-07-18 20:18 UTC]

    Services_Google now implements the iterator interface, allowing you to foreach through the results.

    I think this is working properly, but I don't really have enough experience with iterators to be sure, so if anyone who knows more sees problems, yell :P

  • Jon Wood
    [2004-07-19 12:39 UTC]

    Changed the proposal text to show using the iterator interface, instead of the while loop.

  • Jon Wood
    [2004-07-19 12:41 UTC]

    Tried to move the links to the right place.

  • Jon Wood
    [2004-07-19 12:44 UTC]

    It didn't work, putting them back in the body, I've reported bugs (1909, 1910) for the problems I've been having.