Giter Site home page Giter Site logo

fangj99 / querylist-rule-google Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jae-jae/querylist-rule-google

0.0 2.0 0.0 4 KB

QueryList Plugin: Google searcher,Google Search Engine Scraper in PHP. QueryList谷歌搜索插件

Home Page: https://github.com/jae-jae/QueryList

PHP 100.00%

querylist-rule-google's Introduction

QueryList-Rule-Google

QueryList Plugin: Google searcher,Google Search Engine Scraper in PHP,Crawl Google search results.

QueryList插件:谷歌搜索引擎

QueryList:https://github.com/jae-jae/QueryList

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

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:

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
        )

)

querylist-rule-google's People

Contributors

jae-jae avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.