xp-forge/google-search

此包已被 放弃 并不再维护。没有建议的替代包。

Google Websearch 协议

v6.0.0 2018-02-05 20:17 UTC

This package is auto-updated.

Last update: 2020-08-29 04:09:28 UTC


README

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 协议。请参阅 http://www.google.com/cse/docs/resultsxml.html

示例

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
}