Zend Framework
1.12
|
Public Member Functions | |
__construct ($appId) | |
Sets the application ID and instantiates the REST client. | |
inlinkDataSearch ($query, array $options=array()) | |
Retrieve Inlink Data from siteexplorer.yahoo.com. | |
imageSearch ($query, array $options=array()) | |
Perform a search of images. | |
localSearch ($query, array $options=array()) | |
Perform a search on local.yahoo.com. | |
newsSearch ($query, array $options=array()) | |
Execute a search on news.yahoo.com. | |
pageDataSearch ($query, array $options=array()) | |
Retrieve Page Data from siteexplorer.yahoo.com. | |
videoSearch ($query, array $options=array()) | |
Perform a search of videos. | |
webSearch ($query, array $options=array()) | |
Perform a web content search on search.yahoo.com. | |
getRestClient () | |
Returns a reference to the REST client. | |
Public Attributes | |
$appId | |
Protected Member Functions | |
_validateInlinkDataSearch (array $options) | |
Validate Inlink Data Search Options. | |
_validateImageSearch (array $options) | |
Validate Image Search Options. | |
_validateLocalSearch (array $options) | |
Validate Local Search Options. | |
_validateNewsSearch (array $options) | |
Validate News Search Options. | |
_validatePageDataSearch (array $options) | |
Validate Page Data Search Options. | |
_validateVideoSearch (array $options) | |
Validate Video Search Options. | |
_validateWebSearch (array $options) | |
Validate Web Search Options. | |
_prepareOptions ($query, array $options, array $defaultOptions=array()) | |
Prepare options for sending to Yahoo! | |
_validateLanguage ($lang) | |
Throws an exception if the chosen language is not supported. | |
_compareOptions (array $options, array $validOptions) | |
Utility function to check for a difference between two arrays. | |
_validateInArray ($name, $value, array $array) | |
Check that a named value is in the given array. | |
Static Protected Member Functions | |
static | _checkErrors (DOMDocument $dom) |
Check if response is an error. | |
Protected Attributes | |
$_rest | |
__construct | ( | $appId | ) |
Sets the application ID and instantiates the REST client.
string | $appId | specified the developer's appid |
|
staticprotected |
Check if response is an error.
DOMDocument | $dom | DOM Object representing the result XML |
Zend_Service_Exception | Thrown when the result from Yahoo! is an error |
|
protected |
Utility function to check for a difference between two arrays.
array | $options | User specified options |
array | $validOptions | Valid options |
Zend_Service_Exception | if difference is found (e.g., unsupported query option) |
|
protected |
Prepare options for sending to Yahoo!
string | $query | Search Query |
array | $options | User specified options |
array | $defaultOptions | Required/Default options |
|
protected |
Validate Image Search Options.
array | $options |
Zend_Service_Exception |
|
protected |
Check that a named value is in the given array.
string | $name | Name associated with the value |
mixed | $value | Value |
array | $array | Array in which to check for the value |
Zend_Service_Exception |
|
protected |
Validate Inlink Data Search Options.
array | $options |
Zend_Service_Exception |
|
protected |
Throws an exception if the chosen language is not supported.
string | $lang | Language code |
Zend_Service_Exception |
|
protected |
Validate Local Search Options.
array | $options |
Zend_Service_Exception |
|
protected |
Validate News Search Options.
array | $options |
Zend_Service_Exception |
|
protected |
Validate Page Data Search Options.
array | $options |
Zend_Service_Exception |
|
protected |
Validate Video Search Options.
array | $options |
Zend_Service_Exception |
|
protected |
getRestClient | ( | ) |
Returns a reference to the REST client.
imageSearch | ( | $query, | |
array | $options = array() |
||
) |
Perform a search of images.
The most basic query consists simply of a plain text search, but you can also specify the type of image, the format, color, etc.
The specific options are: 'type' => (all|any|phrase) How to parse the query terms 'results' => int How many results to return, max is 50 'start' => int The start offset for search results 'format' => (any|bmp|gif|jpeg|png) The type of images to search for 'coloration' => (any|color|bw) The coloration of images to search for 'adult_ok' => bool Flag to allow 'adult' images.
string | $query | the query to be run |
array | $options | an optional array of query options |
Zend_Service_Exception |
inlinkDataSearch | ( | $query, | |
array | $options = array() |
||
) |
Retrieve Inlink Data from siteexplorer.yahoo.com.
A basic query consists simply of a URL. Additional options that can be specified consist of: 'results' => int How many results to return, max is 100 'start' => int The start offset for search results 'entire_site' => bool Data for the whole site or a single page 'omit_inlinks' => (none|domain|subdomain) Filter inlinks from these sources
string | $query | the query being run |
array | $options | any optional parameters |
Zend_Service_Exception |
localSearch | ( | $query, | |
array | $options = array() |
||
) |
Perform a search on local.yahoo.com.
The basic search consists of a query and some fragment of location information; for example zipcode, latitude/longitude, or street address.
Query options include: 'results' => int How many results to return, max is 50 'start' => int The start offset for search results 'sort' => (relevance|title|distance|rating) How to order your results
'radius' => float The radius (in miles) in which to search
'longitude' => float The longitude of the location to search around 'latitude' => float The latitude of the location to search around
'zip' => string The zipcode to search around
'street' => string The street address to search around 'city' => string The city for address search 'state' => string The state for address search 'location' => string An adhoc location string to search around
string | $query | The query string you want to run |
array | $options | The search options, including location |
Zend_Service_Exception |
newsSearch | ( | $query, | |
array | $options = array() |
||
) |
Execute a search on news.yahoo.com.
This method minimally takes a text query to search on.
Query options coonsist of:
'results' => int How many results to return, max is 50 'start' => int The start offset for search results 'sort' => (rank|date) How to order your results 'language' => lang The target document language to match 'type' => (all|any|phrase) How the query should be parsed 'site' => string A site to which your search should be restricted
string | $query | The query to run |
array | $options | The array of optional parameters |
Zend_Service_Exception |
pageDataSearch | ( | $query, | |
array | $options = array() |
||
) |
Retrieve Page Data from siteexplorer.yahoo.com.
A basic query consists simply of a URL. Additional options that can be specified consist of: 'results' => int How many results to return, max is 100 'start' => int The start offset for search results 'domain_only' => bool Data for just the given domain or all sub-domains also
string | $query | the query being run |
array | $options | any optional parameters |
Zend_Service_Exception |
videoSearch | ( | $query, | |
array | $options = array() |
||
) |
Perform a search of videos.
The most basic query consists simply of a plain text search, but you can also specify the format of video.
The specific options are: 'type' => (all|any|phrase) How to parse the query terms 'results' => int How many results to return, max is 50 'start' => int The start offset for search results 'format' => (any|avi|flash|mpeg|msmedia|quicktime|realmedia) The type of videos to search for 'adult_ok' => bool Flag to allow 'adult' videos.
string | $query | the query to be run |
array | $options | an optional array of query options |
Zend_Service_Exception |
webSearch | ( | $query, | |
array | $options = array() |
||
) |
Perform a web content search on search.yahoo.com.
A basic query consists simply of a text query. Additional options that can be specified consist of: 'results' => int How many results to return, max is 50 'start' => int The start offset for search results 'language' => lang The target document language to match 'type' => (all|any|phrase) How the query should be parsed 'site' => string A site to which your search should be restricted 'format' => (any|html|msword|pdf|ppt|rss|txt|xls) 'adult_ok' => bool permit 'adult' content in the search results 'similar_ok' => bool permit similar results in the result set 'country' => string The country code for the content searched 'license' => (any|cc_any|cc_commercial|cc_modifiable) The license of content being searched 'region' => The regional search engine on which the service performs the search. default us.
string | $query | the query being run |
array | $options | any optional parameters |
Zend_Service_Exception |
|
protected |
$appId |