Skip to content
This repository has been archived by the owner on Apr 5, 2020. It is now read-only.

xp-forge/google-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

google-search

Build Status on TravisCI XP Framework Module BSD Licence Required PHP 5.5+ Supports PHP 7.0+ Supports HHVM 3.4+ Latest Stable Version

Google Websearch Protocol. See http://www.google.com/cse/docs/resultsxml.html

Example

use com\google\search\custom\GoogleSearchClient;
use util\cmd\Console;

$client= new GoogleSearchClient('http://gsa23.enterprisedemo-google.com/search');
$response= $client->searchFor((new GoogleSearchQuery())
  ->withTerm('test')
  ->startingAt(10)
);

Console::writeLinef('Searching for "test" took %3.f second(s)', $response->getTime());
Console::writeLine('Results: ', $response->getResultSet());

API

$ xp mirror com.google.search.custom
@FileSystemCL<./src/main/php>
@FileSystemCL<./src/test/php>
package com.google.search.custom {
  package com.google.search.custom.types
  package com.google.search.custom.unittest

  public class com.google.search.custom.GoogleSearchClient
  public class com.google.search.custom.GoogleSearchQuery
}