xp-forge / google-search
此包已被 放弃 并不再维护。没有建议的替代包。
Google Websearch 协议
v6.0.0
2018-02-05 20:17 UTC
Requires
- php: >=5.5.0
- xp-framework/core: ^9.0 | ^8.0 | ^7.0 | ^6.5
- xp-framework/http: ^9.0 | ^8.0 | ^7.0 | ^6.0
- xp-framework/xml: ^9.0 | ^8.0 | ^7.0 | ^6.0
Requires (Dev)
- xp-framework/unittest: ^9.0 | ^8.0 | ^7.0 | ^6.5
README
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 }