[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/lib/zend/Zend/Service/ -> Yahoo.php (summary)

Zend Framework LICENSE

Copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
License: http://framework.zend.com/license/new-bsd New BSD License
Version: $Id$
File Size: 956 lines (35 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Zend_Service_Yahoo:: (21 methods):
  __construct()
  inlinkDataSearch()
  imageSearch()
  localSearch()
  newsSearch()
  pageDataSearch()
  videoSearch()
  webSearch()
  getRestClient()
  _validateInlinkDataSearch()
  _validateImageSearch()
  _validateLocalSearch()
  _validateNewsSearch()
  _validatePageDataSearch()
  _validateVideoSearch()
  _validateWebSearch()
  _prepareOptions()
  _validateLanguage()
  _compareOptions()
  _validateInArray()
  _checkErrors()


Class: Zend_Service_Yahoo  - X-Ref


__construct($appId)   X-Ref
Sets the application ID and instantiates the REST client

param: string $appId specified the developer's appid
return: void

inlinkDataSearch($query, array $options = array()   X-Ref
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

param: string $query    the query being run
param: array  $options  any optional parameters
return: Zend_Service_Yahoo_ResultSet  The return set

imageSearch($query, array $options = array()   X-Ref
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.

param: string $query   the query to be run
param: array  $options an optional array of query options
return: Zend_Service_Yahoo_ImageResultSet the search results

localSearch($query, array $options = array()   X-Ref
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

param: string $query    The query string you want to run
param: array  $options  The search options, including location
return: Zend_Service_Yahoo_LocalResultSet The results

newsSearch($query, array $options = array()   X-Ref
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

param: string $query    The query to run
param: array  $options  The array of optional parameters
return: Zend_Service_Yahoo_NewsResultSet  The query return set

pageDataSearch($query, array $options = array()   X-Ref
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

param: string $query    the query being run
param: array  $options  any optional parameters
return: Zend_Service_Yahoo_ResultSet  The return set

videoSearch($query, array $options = array()   X-Ref
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.

param: string $query   the query to be run
param: array  $options an optional array of query options
return: Zend_Service_Yahoo_VideoResultSet the search results

webSearch($query, array $options = array()   X-Ref
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.

param: string $query    the query being run
param: array  $options  any optional parameters
return: Zend_Service_Yahoo_WebResultSet  The return set

getRestClient()   X-Ref
Returns a reference to the REST client

return: Zend_Rest_Client

_validateInlinkDataSearch(array $options)   X-Ref
Validate Inlink Data Search Options

param: array $options
return: void

_validateImageSearch(array $options)   X-Ref
Validate Image Search Options

param: array $options
return: void

_validateLocalSearch(array $options)   X-Ref
Validate Local Search Options

param: array $options
return: void

_validateNewsSearch(array $options)   X-Ref
Validate News Search Options

param: array $options
return: void

_validatePageDataSearch(array $options)   X-Ref
Validate Page Data Search Options

param: array $options
return: void

_validateVideoSearch(array $options)   X-Ref
Validate Video Search Options

param: array $options
return: void

_validateWebSearch(array $options)   X-Ref
Validate Web Search Options

param: array $options
return: void

_prepareOptions($query, array $options, array $defaultOptions = array()   X-Ref
Prepare options for sending to Yahoo!

param: string $query          Search Query
param: array  $options        User specified options
param: array  $defaultOptions Required/Default options
return: array

_validateLanguage($lang)   X-Ref
Throws an exception if the chosen language is not supported

param: string $lang Language code
return: void

_compareOptions(array $options, array $validOptions)   X-Ref
Utility function to check for a difference between two arrays.

param: array $options      User specified options
param: array $validOptions Valid options
return: void

_validateInArray($name, $value, array $array)   X-Ref
Check that a named value is in the given array

param: string $name  Name associated with the value
param: mixed  $value Value
param: array  $array Array in which to check for the value
return: void

_checkErrors(DOMDocument $dom)   X-Ref
Check if response is an error

param: DOMDocument $dom DOM Object representing the result XML
return: void



Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1