Class Zend_Service_Yahoo

Description
  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Service/Yahoo.php (line 32)


	
			
Variable Summary
Method Summary
 static void _checkErrors ( $dom)
 void __construct (string $appId)
 Zend_Service_Yahoo_ImageResultSet imageSearch (string $query, [ $options = array()])
 Zend_Service_Yahoo_LocalResultSet localSearch (string $query, [ $options = array()])
 Zend_Service_Yahoo_NewsResultSet newsSearch (string $query, [ $options = array()])
 Zend_Service_Yahoo_WebResultSet webSearch (string $query, [ $options = array()])
 void _compareOptions ( $options,  $validOptions)
 array _prepareOptions (string $query,  $options, [ $defaultOptions = array()])
 void _validateImageSearch ( $options)
 void _validateInArray (string $name, mixed $value,  $array)
 void _validateLanguage (string $lang)
 void _validateLocalSearch ( $options)
 void _validateNewsSearch ( $options)
 void _validateWebSearch ( $options)
Variables
string $appId (line 39)

Yahoo Developer Application ID

  • access: public
Zend_Rest_Client $_rest (line 46)

Reference to the REST client

  • access: protected
Methods
static _checkErrors (line 655)

Check if response is an error

  • throws: Zend_Service_Exception Thrown when the result from Yahoo! is an error
  • access: protected
static void _checkErrors ( $dom)
  • DOMDocument $dom: DOM Object representing the result XML
Constructor __construct (line 55)

Sets the application ID and instantiates the REST client

  • access: public
void __construct (string $appId)
  • string $appId: specified the developer's appid
getRestClient (line 300)

Returns a reference to the REST client

  • access: public
Zend_Rest_Client getRestClient ()
imageSearch (line 83)

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.

  • return: the search results
  • access: public
Zend_Service_Yahoo_ImageResultSet imageSearch (string $query, [ $options = array()])
  • string $query: the query to be run
  • array $options: an optional array of query options
localSearch (line 147)

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

  • return: The results
  • access: public
Zend_Service_Yahoo_LocalResultSet localSearch (string $query, [ $options = array()])
  • string $query: The query string you want to run
  • array $options: The search options, including location
newsSearch (line 201)

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

  • return: The query return set
  • access: public
Zend_Service_Yahoo_NewsResultSet newsSearch (string $query, [ $options = array()])
  • string $query: The query to run
  • array $options: The array of optional parameters
webSearch (line 257)

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

  • return: The return set
  • access: public
Zend_Service_Yahoo_WebResultSet webSearch (string $query, [ $options = array()])
  • string $query: the query being run
  • array $options: any optional parameters
_compareOptions (line 614)

Utility function to check for a difference between two arrays.

  • throws: Zend_Service_Exception if difference is found (e.g., unsupported query option)
  • access: protected
void _compareOptions ( $options,  $validOptions)
  • array $options: User specified options
  • array $validOptions: Valid options
_prepareOptions (line 574)

Prepare options for sending to Yahoo!

  • access: protected
array _prepareOptions (string $query,  $options, [ $defaultOptions = array()])
  • string $query: Search Query
  • array $options: User specified options
  • array $defaultOptions: Required/Default options
_validateImageSearch (line 313)

Validate Image Search Options

  • throws: Zend_Service_Exception
  • access: protected
void _validateImageSearch ( $options)
  • array $options
_validateInArray (line 636)

Check that a named value is in the given array

  • throws: Zend_Service_Exception
  • access: protected
void _validateInArray (string $name, mixed $value,  $array)
  • string $name: Name associated with the value
  • mixed $value: Value
  • array $array: Array in which to check for the value
_validateLanguage (line 590)

Throws an exception if the chosen language is not supported

  • throws: Zend_Service_Exception
  • access: protected
void _validateLanguage (string $lang)
  • string $lang: Language code
_validateLocalSearch (line 398)

Validate Local Search Options

  • throws: Zend_Service_Exception
  • access: protected
void _validateLocalSearch ( $options)
  • array $options
_validateNewsSearch (line 485)

Validate News Search Options

  • throws: Zend_Service_Exception
  • access: protected
void _validateNewsSearch ( $options)
  • array $options
_validateWebSearch (line 527)

Validate Web Search Options

  • throws: Zend_Service_Exception
  • access: protected
void _validateWebSearch ( $options)
  • array $options

Documentation generated on Sun, 27 May 2007 23:28:44 -0700 by phpDocumentor 1.3.2