2017 © Pedro Peláez
 

library querylist-rule-google

QueryList Plugin: Google searcher. QueryList谷歌搜索插件

image

jaeger/querylist-rule-google

QueryList Plugin: Google searcher. QueryList谷歌搜索插件

  • Monday, October 2, 2017
  • by jae
  • Repository
  • 1 Watchers
  • 4 Stars
  • 145 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 2 Versions
  • 17 % Grown

The README.md

QueryList-Rule-Google

QueryList Plugin: Google searcher,Google Search Engine Scraper in PHP,Crawl Google search results., (*1)

QueryList插件:谷歌搜索引擎, (*2)

QueryList:https://github.com/jae-jae/QueryList, (*3)

Installation for QueryList4

composer require jaeger/querylist-rule-google

API

  • Google google($pageNumber = 10):get Google Searcher.

class Google: - Google search($keyword):set search keyword. - Google setHttpOpt(array $httpOpt = []):Set the http option,see: GuzzleHttp options - int getCount():Get the total number of search results. - int getCountPage():Get the total number of pages. - Collection page($page = 1):Get search results, (*4)

Usage

  • Installation Plugin
use QL\QueryList;
use QL\Ext\Google;

$ql = QueryList::getInstance();
$ql->use(Google::class);
//or Custom function name
$ql->use(Google::class,'google');
  • Example-1
$google = $ql->google(10)
$searcher = $google->search('QueryList');
$count = $searcher->getCount();
$data = $searcher->page(1);
$data = $searcher->page(2);

$searcher = $google->search('php');
$countPage = $searcher->getCountPage();
for ($page = 1; $page <= $countPage; $page++)
{
    $data = $searcher->page($page);
}
  • Example-2
$searcher = $ql->google()->search('QueryList');
$data = $searcher->setHttpOpt([
    // Set the http proxy
    'proxy' => 'http://222.141.11.17:8118',
   // Set the timeout time in seconds
    'timeout' => 30,
])->page(1);
print_r($data->all());
  • Example-3
$data= $searcher = $ql->google(3)->search('QueryList')->page(1);
print_r($data->all());

Out:, (*5)

Array
(
    [0] => Array
        (
            [title] => Angular - QueryList
            [link] => https://angular.io/api/core/QueryList
        )
    [1] => Array
        (
            [title] => QueryList | @angular/core - Angularリファレンス - Web Creative Park
            [link] => http://www.webcreativepark.net/angular/querylist/
        )
    [2] => Array
        (
            [title] => Understanding ViewChildren, ContentChildren, and QueryList in ...
            [link] => https://netbasal.com/understanding-viewchildren-contentchildren-and-querylist-in-angular-896b0c689f6e
        )

)

The Versions

02/10 2017

dev-master

9999999-dev

QueryList Plugin: Google searcher. QueryList谷歌搜索插件

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Jaeger

01/10 2017

4.0.0

4.0.0.0

QueryList Plugin: Google searcher. QueryList谷歌搜索插件

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Jaeger