Service/Yahoo.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Service
- Subpackage
- Yahoo
- Version
- $Id$
\Zend_Service_Yahoo
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties
Methods
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
__construct(string $appId) : void
Sets the application ID and instantiates the REST client
Name | Type | Description |
---|---|---|
$appId | string | specified the developer's appid |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
_checkErrors(\DOMDocument $dom) : void
Check if response is an error
Name | Type | Description |
---|---|---|
$dom | \DOMDocument | DOM Object representing the result XML |
Exception | Description |
---|---|
\Zend_Service_Exception | Thrown when the result from Yahoo! is an error |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
_compareOptions(array $options, array $validOptions) : void
Utility function to check for a difference between two arrays.
Name | Type | Description |
---|---|---|
$options | array | User specified options |
$validOptions | array | Valid options |
Exception | Description |
---|---|
\Zend_Service_Exception | if difference is found (e.g., unsupported query option) |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
_prepareOptions(string $query, array $options, array $defaultOptions = array()) : array
Prepare options for sending to Yahoo!
Name | Type | Description |
---|---|---|
$query | string | Search Query |
$options | array | User specified options |
$defaultOptions | array | Required/Default options |
Type | Description |
---|---|
array |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
_validateImageSearch(array $options) : void
Validate Image Search Options
Name | Type | Description |
---|---|---|
$options | array |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
_validateInArray(string $name, mixed $value, array $array) : void
Check that a named value is in the given array
Name | Type | Description |
---|---|---|
$name | string | Name associated with the value |
$value | mixed | Value |
$array | array | Array in which to check for the value |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
_validateInlinkDataSearch(array $options) : void
Validate Inlink Data Search Options
Name | Type | Description |
---|---|---|
$options | array |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
_validateLanguage(string $lang) : void
Throws an exception if the chosen language is not supported
Name | Type | Description |
---|---|---|
$lang | string | Language code |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
_validateLocalSearch(array $options) : void
Validate Local Search Options
Name | Type | Description |
---|---|---|
$options | array |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
_validateNewsSearch(array $options) : void
Validate News Search Options
Name | Type | Description |
---|---|---|
$options | array |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
_validatePageDataSearch(array $options) : void
Validate Page Data Search Options
Name | Type | Description |
---|---|---|
$options | array |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
_validateVideoSearch(array $options) : void
Validate Video Search Options
Name | Type | Description |
---|---|---|
$options | array |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
_validateWebSearch(array $options) : void
Validate Web Search Options
Name | Type | Description |
---|---|---|
$options | array |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
getRestClient() : \Zend_Rest_Client
Returns a reference to the REST client
Type | Description |
---|---|
\Zend_Rest_Client |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
imageSearch(string $query, array $options = array()) : \Zend_Service_Yahoo_ImageResultSet
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.
Name | Type | Description |
---|---|---|
$query | string | the query to be run |
$options | array | an optional array of query options |
Type | Description |
---|---|
\Zend_Service_Yahoo_ImageResultSet | the search results |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
inlinkDataSearch(string $query, array $options = array()) : \Zend_Service_Yahoo_ResultSet
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
Name | Type | Description |
---|---|---|
$query | string | the query being run |
$options | array | any optional parameters |
Type | Description |
---|---|
\Zend_Service_Yahoo_ResultSet | The return set |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
localSearch(string $query, array $options = array()) : \Zend_Service_Yahoo_LocalResultSet
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.
Name | Type | Description |
---|---|---|
$query | string | The query string you want to run |
$options | array | The search options, including location |
Type | Description |
---|---|
\Zend_Service_Yahoo_LocalResultSet | The results |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
newsSearch(string $query, array $options = array()) : \Zend_Service_Yahoo_NewsResultSet
Execute a search on news.yahoo.com. This method minimally takes a text query to search on.
Name | Type | Description |
---|---|---|
$query | string | The query to run |
$options | array | The array of optional parameters |
Type | Description |
---|---|
\Zend_Service_Yahoo_NewsResultSet | The query return set |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
pageDataSearch(string $query, array $options = array()) : \Zend_Service_Yahoo_ResultSet
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
Name | Type | Description |
---|---|---|
$query | string | the query being run |
$options | array | any optional parameters |
Type | Description |
---|---|
\Zend_Service_Yahoo_ResultSet | The return set |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
videoSearch(string $query, array $options = array()) : \Zend_Service_Yahoo_VideoResultSet
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.
Name | Type | Description |
---|---|---|
$query | string | the query to be run |
$options | array | an optional array of query options |
Type | Description |
---|---|
\Zend_Service_Yahoo_VideoResultSet | the search results |
Exception | Description |
---|---|
\Zend_Service_Exception |
![](../images/icons/arrow_right.png)
![method method](../images/icons/method.png)
webSearch(string $query, array $options = array()) : \Zend_Service_Yahoo_WebResultSet
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.
Name | Type | Description |
---|---|---|
$query | string | the query being run |
$options | array | any optional parameters |
Type | Description |
---|---|
\Zend_Service_Yahoo_WebResultSet | The return set |
Exception | Description |
---|---|
\Zend_Service_Exception |