2017 © Pedro Peláez
 

library sitesearch

Google Site Search custom search PHP Wrapper Library

image

gabrielbull/sitesearch

Google Site Search custom search PHP Wrapper Library

  • Wednesday, July 6, 2016
  • by gabrielbull
  • Repository
  • 1 Watchers
  • 0 Stars
  • 29 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PHP Google Site Search

Build Status, (*1)

Search engine for websites using Google Custom Search Engine with a Google Site Search account., (*2)

Google Site Search API

To use the Google Site Search API, you have to obtain a search engine ID from Google., (*3)

Requirements

This library uses PHP 5.3+., (*4)

Installation

It is recommended that you install the PHP Google Site Search library through composer., (*5)

{
    "require": {
        "gabrielbull/sitesearch": "dev-master"
    }
}

The SiteSearch class allows you to search Google Custom Search Engine. All you have to provide is a search engine ID and a query., (*6)

Examples

$id = "YOUR_SEARCH_ENGINE_ID";

$siteSearch = new SiteSearch($id);
$results = $siteSearch->search('kittens');

foreach($results as $result) {
    echo $result['title'];
}

or:, (*7)

$id = "YOUR_SEARCH_ENGINE_ID";

foreach(SiteSearch::create($id)->search('cats') as $result) {
    echo $result['title'];
}

Parameters

The search method parameters are:, (*8)

  • value The search query.
  • start The offset of the first result to return.
  • limit The number of results to return.

Results

The search results will contain the following parameters:, (*9)

  • link The link of the page.
  • title The title of the page.
  • description The description of the page.
  • lang The language of the page.
  • image An image associated with the page (src).
  • thumbnail A thumbnail of the image (src, width and height).

The Versions

06/07 2016

dev-master

9999999-dev https://github.com/gavroche/php-sitesearch

Google Site Search custom search PHP Wrapper Library

  Sources   Download

MIT

api search google engine custom site