Class Zend_Service_Yahoo

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

Located in /Zend/Service/Yahoo.php (line 96)


	
			
Variable Summary
Method Summary
 static void _checkErrors ( $dom)
 Zend_Service_Yahoo __construct (string $appid)
 Zend_Service_Yahoo_ImageResultSet imageSearch (string $query, [array $options = NULL])
 Zend_Service_Yahoo_LocalResultSet localSearch (string $query, [array $options = NULL])
 Zend_Service_Yahoo_NewsResultSet newsSearch (string $query, [array $options = NULL])
 Zend_Service_Yahoo_WebResultSet webSearch (string $query, [array $options = NULL])
 void _compareOptions (array $options, array $valid_options)
 void _prepareOptions (string $query, array $options, array $default_options)
 void _validateImageSearch (array $options)
 void _validateInArray (string $name, mixed $value, array $array)
 void _validateLanguage (string $lang)
 void _validateLocalSearch (array $options)
 void _validateNewsSearch (array $options)
 boolean _validateNumber ( $name, array $number, int $max, [int $min = 1], string $type)
 void _validateWebSearch (array $options)
Variables
string $appId (line 102)

Yahoo Developer Application ID

  • access: public
Zend_Service_Rest $_rest (line 109)

Zend_Service_Rest instance

  • access: protected
Methods
static _checkErrors (line 601)

Check if response is an error

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

Constructs a new search object for the given application id.

  • access: public
Zend_Service_Yahoo __construct (string $appid)
  • string $appid: specified the developer's appid
imageSearch (line 141)

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, [array $options = NULL])
  • string $query: the query to be run
  • array $options: an optional array of query options.
localSearch (line 199)

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 raidus (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, [array $options = NULL])
  • string $query: The query string you want to run
  • array $options: The search options, including location
newsSearch (line 245)

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, [array $options = NULL])
  • string $query: The query to run
  • array $options: The array of optional parameters
webSearch (line 290)

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, [array $options = NULL])
  • string $query: the query being run
  • array $options: any optional parameters
_compareOptions (line 570)

Utility function to check for a difference between two arrays.

  • access: protected
  • throws: Zend_Service_Exception if difference is found (e.g. illegitimate query options)
void _compareOptions (array $options, array $valid_options)
  • array $options: User specified options
  • array $valid_options: Valid options
_prepareOptions (line 519)

Prepare options for sending to Yahoo!

  • access: protected
void _prepareOptions (string $query, array $options, array $default_options)
  • string $query: Search Query
  • array $options: User specified options
  • array $default_options: Requied/Default options
_validateImageSearch (line 385)

Validate Image Search Options

  • access: protected
void _validateImageSearch (array $options)
  • array $options
_validateInArray (line 587)

Check that a named value is in the given array

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

Utility function to confirm chosen language is supported by Yahoo!

  • access: protected
void _validateLanguage (string $lang)
  • string $lang: Language code
_validateLocalSearch (line 324)

Validate Local Search Options

  • access: protected
void _validateLocalSearch (array $options)
  • array $options
_validateNewsSearch (line 446)

Validate News Search Options

  • access: protected
void _validateNewsSearch (array $options)
  • array $options
_validateNumber (line 538)

Utility function to check if input is an int and falls in a specified range.

  • access: protected
  • throws: XN_Exception if number does not fall in range; with $name and valid range
boolean _validateNumber ( $name, array $number, int $max, [int $min = 1], string $type)
  • array $number: 1d array, 'name' => int
  • string $type: float or int
  • int $max: maximum value
  • int $min: minimum value (default 1)
  • $name
_validateWebSearch (line 481)

Validate Web Search Options

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

Documentation generated on Thu, 18 Jan 2007 10:00:15 -0800 by phpDocumentor 1.3.1