Moodle  2.2.1
http://www.collinsharper.com
Zend_Service_Yahoo Class Reference

Public Member Functions

 __construct ($appId)
 inlinkDataSearch ($query, array $options=array())
 imageSearch ($query, array $options=array())
 localSearch ($query, array $options=array())
 newsSearch ($query, array $options=array())
 pageDataSearch ($query, array $options=array())
 videoSearch ($query, array $options=array())
 webSearch ($query, array $options=array())
 getRestClient ()

Data Fields

 $appId

Protected Member Functions

 _validateInlinkDataSearch (array $options)
 _validateImageSearch (array $options)
 _validateLocalSearch (array $options)
 _validateNewsSearch (array $options)
 _validatePageDataSearch (array $options)
 _validateVideoSearch (array $options)
 _validateWebSearch (array $options)
 _prepareOptions ($query, array $options, array $defaultOptions=array())
 _validateLanguage ($lang)
 _compareOptions (array $options, array $validOptions)
 _validateInArray ($name, $value, array $array)

Static Protected Member Functions

static _checkErrors (DOMDocument $dom)

Protected Attributes

 $_rest

Detailed Description

Definition at line 32 of file Yahoo.php.


Constructor & Destructor Documentation

__construct ( appId)

Sets the application ID and instantiates the REST client

Parameters:
string$appIdspecified the developer's appid
Returns:
void
See also:
Zend_Rest_Client

Definition at line 55 of file Yahoo.php.


Member Function Documentation

static _checkErrors ( DOMDocument $  dom) [static, protected]

Check if response is an error

Parameters:
DOMDocument$domDOM Object representing the result XML
Returns:
void
Exceptions:
Zend_Service_ExceptionThrown when the result from Yahoo! is an error
See also:
Zend_Service_Exception

Definition at line 942 of file Yahoo.php.

Here is the caller graph for this function:

_compareOptions ( array options,
array validOptions 
) [protected]

Utility function to check for a difference between two arrays.

Parameters:
array$optionsUser specified options
array$validOptionsValid options
Returns:
void
Exceptions:
Zend_Service_Exceptionif difference is found (e.g., unsupported query option)
See also:
Zend_Service_Exception

Definition at line 901 of file Yahoo.php.

Here is the caller graph for this function:

_prepareOptions ( query,
array options,
array defaultOptions = array() 
) [protected]

Prepare options for sending to Yahoo!

Parameters:
string$querySearch Query
array$optionsUser specified options
array$defaultOptionsRequired/Default options
Returns:
array

Definition at line 861 of file Yahoo.php.

Here is the caller graph for this function:

_validateImageSearch ( array options) [protected]

Validate Image Search Options

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception
Zend_Validate_Between
Zend_Service_Exception
Zend_Service_Exception
Zend_Service_Exception
Zend_Service_Exception

Definition at line 505 of file Yahoo.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateInArray ( name,
value,
array array 
) [protected]

Check that a named value is in the given array

Parameters:
string$nameName associated with the value
mixed$valueValue
array$arrayArray in which to check for the value
Returns:
void
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception

Definition at line 923 of file Yahoo.php.

Here is the caller graph for this function:

_validateInlinkDataSearch ( array options) [protected]

Validate Inlink Data Search Options

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Exception
See also:
Zend_Validate_Between
Zend_Service_Exception
Zend_Service_Exception

Definition at line 464 of file Yahoo.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateLanguage ( lang) [protected]

Throws an exception if the chosen language is not supported

Parameters:
string$langLanguage code
Returns:
void
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception

Definition at line 877 of file Yahoo.php.

Here is the caller graph for this function:

_validateLocalSearch ( array options) [protected]

Validate Local Search Options

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Exception
See also:
Zend_Validate_Between
Zend_Service_Exception
Zend_Service_Exception
Zend_Service_Exception
Zend_Service_Exception
Zend_Service_Exception
Zend_Service_Exception
Zend_Service_Exception

Definition at line 590 of file Yahoo.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateNewsSearch ( array options) [protected]

Validate News Search Options

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Exception
See also:
Zend_Validate_Between
Zend_Service_Exception
Zend_Service_Exception

Definition at line 677 of file Yahoo.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validatePageDataSearch ( array options) [protected]

Validate Page Data Search Options

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Exception
See also:
Zend_Validate_Between
Zend_Service_Exception
Zend_Service_Exception

Definition at line 721 of file Yahoo.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateVideoSearch ( array options) [protected]

Validate Video Search Options

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Exception
See also:
Zend_Validate_Between
Zend_Service_Exception
Zend_Service_Exception

Definition at line 758 of file Yahoo.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateWebSearch ( array options) [protected]

Validate Web Search Options

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Exception
See also:
Zend_Validate_Between
Zend_Service_Exception
Zend_Service_Exception

Definition at line 803 of file Yahoo.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns a reference to the REST client

Returns:
Zend_Rest_Client

Definition at line 451 of file Yahoo.php.

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.

Parameters:
string$querythe query to be run
array$optionsan optional array of query options
Returns:
Zend_Service_Yahoo_ImageResultSet the search results
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception
Zend_Service_YahooImageResultSet

Definition at line 132 of file Yahoo.php.

Here is the call graph for this function:

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

Parameters:
string$querythe query being run
array$optionsany optional parameters
Returns:
Zend_Service_Yahoo_ResultSet The return set
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception
Zend_Service_Yahoo_InlinkDataResultSet

Definition at line 80 of file Yahoo.php.

Here is the call graph for this function:

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

Parameters:
string$queryThe query string you want to run
array$optionsThe search options, including location
Returns:
Zend_Service_Yahoo_LocalResultSet The results
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception
Zend_Service_Yahoo_LocalResultSet

Definition at line 197 of file Yahoo.php.

Here is the call graph for this function:

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

Parameters:
string$queryThe query to run
array$optionsThe array of optional parameters
Returns:
Zend_Service_Yahoo_NewsResultSet The query return set
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception
Zend_Service_Yahoo_NewsResultSet

Definition at line 252 of file Yahoo.php.

Here is the call graph for this function:

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

Parameters:
string$querythe query being run
array$optionsany optional parameters
Returns:
Zend_Service_Yahoo_ResultSet The return set
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception
Zend_Service_Yahoo_PageDataResultSet

Definition at line 301 of file Yahoo.php.

Here is the call graph for this function:

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.

Parameters:
string$querythe query to be run
array$optionsan optional array of query options
Returns:
Zend_Service_Yahoo_VideoResultSet the search results
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception
Zend_Service_YahooVideoResultSet

Definition at line 352 of file Yahoo.php.

Here is the call graph for this function:

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.

Parameters:
string$querythe query being run
array$optionsany optional parameters
Returns:
Zend_Service_Yahoo_WebResultSet The return set
Exceptions:
Zend_Service_Exception
See also:
Zend_Service_Exception
Zend_Service_Yahoo_WebResultSet

Definition at line 410 of file Yahoo.php.

Here is the call graph for this function:


Field Documentation

$_rest [protected]

Definition at line 46 of file Yahoo.php.

$appId

Definition at line 39 of file Yahoo.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations