phpDocumentor Swift
[ class tree: Swift ] [ index: Swift ] [ all elements ]

Class: SwiftGoogle

Source Location: /classes/SwiftGoogle.php

Class SwiftGoogle

Class Overview

This class contains functions to extract web elements Google API quick and easily.

Located in /classes/SwiftGoogle.php [line 42]



		
		
		
		

Methods

[ Top ]
Method Summary
SwiftGoogle   __construct()   Creates and initializes a new SwiftGoogle object with the given referer url and Google api key params.
array   getBlogs()   Fetch blog results from Google API using the given query keyphrase and settings
array   getBooks()   Fetch book results from Google API using the given query keyphrase and settings
array   getImages()   Fetch image results from Google API using the given query keyphrase and settings
string   getKey()   Get the current Google API key for this Google object.
array   getNews()   Fetch news results from Google API using the given query keyphrase and settings
string   getReferer()   Gets the current referer url for this Google object.
array   getVideos()   Fetch video results from Google API using the given query keyphrase and settings
array   getWebs()   Fetch web search results from Google API using the given query keyphrase and settings
void   setKey()   Set the Google API key for this Google object.
void   setReferer()   Set the referer url for the Google object.

[ Top ]
Methods
Constructor __construct  [line 55]

  SwiftGoogle __construct( string $referer, [string $key = null]  )

Creates and initializes a new SwiftGoogle object with the given referer url and Google api key params.

Parameters:
string   $referer:  Referer url
string   $key:  Google API key

API Tags:
Return:  The new SwiftGoogle object
Access:  public


[ Top ]
getBlogs  [line 211]

  array getBlogs( string $query, [boolean $sortByDate = false], [string $numResults = "small"]  )

Fetch blog results from Google API using the given query keyphrase and settings

Parameters:
string   $query:  The search query or keyword(s) to use
boolean   $sortByDate:  Whether to sort by date or not to
string   $numResults:  Size of results to fetch (small or large)

API Tags:
Return:  An array containing all results
Access:  public


[ Top ]
getBooks  [line 124]

  array getBooks( string $query, [string $fullView = false], [string $numResults = "small"]  )

Fetch book results from Google API using the given query keyphrase and settings

Parameters:
string   $query:  The search query or keyword(s) to use
string   $fullView:  Whether to fetch only full view books or all types
string   $numResults:  Size of results to fetch (small or large)

API Tags:
Return:  An array containing all results
Access:  public


[ Top ]
getImages  [line 292]

  array getImages( string $query, [string $fileType = null], [string $numResults = "small"]  )

Fetch image results from Google API using the given query keyphrase and settings

Parameters:
string   $query:  The search query or keyword(s) to use
string   $fileType:  Specific file type (.jpg,.png,etc) or null for any
string   $numResults:  Size of results to fetch (small or large)

API Tags:
Return:  An array containing all results
Access:  public


[ Top ]
getKey  [line 88]

  string getKey( )

Get the current Google API key for this Google object.


API Tags:
Return:  Google API key string
Access:  public


[ Top ]
getNews  [line 165]

  array getNews( string $query, [string $topic = null], [string $edition = "us"], [boolean $sortByDate = false], [string $numResults = "small"]  )

Fetch news results from Google API using the given query keyphrase and settings

Parameters:
string   $query:  The search query or keyword(s) to use
string   $topic:  Google news topic id or null
string   $edition:  us or other country codes from Google
boolean   $sortByDate:  Whether to sort by date or not to
string   $numResults:  Size of results to fetch (small or large)

API Tags:
Return:  An array containing all results
Access:  public


[ Top ]
getReferer  [line 72]

  string getReferer( )

Gets the current referer url for this Google object.


API Tags:
Return:  The referer url string
Access:  public


[ Top ]
getVideos  [line 248]

  array getVideos( string $query, [boolean $sortByDate = false], [string $numResults = "small"]  )

Fetch video results from Google API using the given query keyphrase and settings

Parameters:
string   $query:  The search query or keyword(s) to use
boolean   $sortByDate:  Whether to sort by date or not to
string   $numResults:  Size of results to fetch (small or large)

API Tags:
Return:  An array containing all results
Access:  public


[ Top ]
getWebs  [line 334]

  array getWebs( string $query, [string $numResults = "small"]  )

Fetch web search results from Google API using the given query keyphrase and settings

Parameters:
string   $query:  The search query or keyword(s) to use
string   $numResults:  Size of results to fetch (small or large)

API Tags:
Return:  An array containing all results
Access:  public


[ Top ]
setKey  [line 80]

  void setKey( string $value  )

Set the Google API key for this Google object.

Parameters:
string   $value:  Google API key

API Tags:
Access:  public


[ Top ]
setReferer  [line 64]

  void setReferer( string $value  )

Set the referer url for the Google object.

Parameters:
string   $value:  Referer url

API Tags:
Access:  public


[ Top ]

Documentation generated on Tue, 08 Oct 2013 05:37:15 +0200 by phpDocumentor 1.4.4