API Documentation

Service/Yahoo.php

Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Service
subpackage
Yahoo
version
$Id: Yahoo.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Service_Yahoo

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Service_Yahoo

category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Service
subpackage
Yahoo
Properties
$appId
$_rest
Methods
__construct
inlinkDataSearch
imageSearch
localSearch
newsSearch
pageDataSearch
videoSearch
webSearch
getRestClient
_validateInlinkDataSearch
_validateImageSearch
_validateLocalSearch
_validateNewsSearch
_validatePageDataSearch
_validateVideoSearch
_validateWebSearch
_prepareOptions
_validateLanguage
_compareOptions
_validateInArray
_checkErrors

Description

Properties

$_rest

Zend_Rest_Client $_rest = ''

Reference to the REST client

Details

$_rest
Zend_Rest_Client
visibility
protected
default
final
false
static
false

$appId

string $appId = ''

Yahoo Developer Application ID

Details

$appId
string
visibility
public
default
final
false
static
false

Methods

__construct

__construct( string $appId ) : void

Sets the application ID and instantiates the REST client

Arguments
$appId
string
specified the developer's appid
Details
visibility
public
final
false
static
false

_checkErrors

_checkErrors( DOMDocument $dom ) : void

Check if response is an error

Arguments
$dom
DOMDocument
DOM Object representing the result XML
Details
visibility
protected
final
false
static
true
throws
Thrown when the result from Yahoo! is an error

_compareOptions

_compareOptions( array $options, array $validOptions ) : void

Utility function to check for a difference between two arrays.

Arguments
$options
array
User specified options
$validOptions
array
Valid options
Details
visibility
protected
final
false
static
false
throws
if difference is found (e.g., unsupported query option)

_prepareOptions

_prepareOptions( string $query, array $options, array $defaultOptions = array ) : array

Prepare options for sending to Yahoo!

Arguments
$query
string
Search Query
$options
array
User specified options
$defaultOptions
array
Required/Default options
Output
array
Details
visibility
protected
final
false
static
false

_validateImageSearch

_validateImageSearch( array $options ) : void

Validate Image Search Options

Arguments
$options
array
Details
visibility
protected
final
false
static
false
throws

_validateInArray

_validateInArray( string $name, mixed $value, array $array ) : void

Check that a named value is in the given array

Arguments
$name
string
Name associated with the value
$value
mixed
Value
$array
array
Array in which to check for the value
Details
visibility
protected
final
false
static
false
throws

_validateInlinkDataSearch

_validateInlinkDataSearch( array $options ) : void

Validate Inlink Data Search Options

Arguments
$options
array
Details
visibility
protected
final
false
static
false
throws

_validateLanguage

_validateLanguage( string $lang ) : void

Throws an exception if the chosen language is not supported

Arguments
$lang
string
Language code
Details
visibility
protected
final
false
static
false
throws

_validateLocalSearch

_validateLocalSearch( array $options ) : void

Validate Local Search Options

Arguments
$options
array
Details
visibility
protected
final
false
static
false
throws

_validateNewsSearch

_validateNewsSearch( array $options ) : void

Validate News Search Options

Arguments
$options
array
Details
visibility
protected
final
false
static
false
throws

_validatePageDataSearch

_validatePageDataSearch( array $options ) : void

Validate Page Data Search Options

Arguments
$options
array
Details
visibility
protected
final
false
static
false
throws

_validateVideoSearch

_validateVideoSearch( array $options ) : void

Validate Video Search Options

Arguments
$options
array
Details
visibility
protected
final
false
static
false
throws

_validateWebSearch

_validateWebSearch( array $options ) : void

Validate Web Search Options

Arguments
$options
array
Details
visibility
protected
final
false
static
false
throws

getRestClient

getRestClient( ) : Zend_Rest_Client

Returns a reference to the REST client

Details
visibility
public
final
false
static
false

imageSearch

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.

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.

Arguments
$query
string
the query to be run
$options
array
an optional array of query options
Output
Zend_Service_Yahoo_ImageResultSet
the search results
Details
visibility
public
final
false
static
false
throws

inlinkDataSearch

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

Arguments
$query
string
the query being run
$options
array
any optional parameters
Output
Zend_Service_Yahoo_ResultSet
The return set
Details
visibility
public
final
false
static
false
throws

localSearch

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.

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

Arguments
$query
string
The query string you want to run
$options
array
The search options, including location
Details
visibility
public
final
false
static
false
throws

newsSearch

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.

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

Arguments
$query
string
The query to run
$options
array
The array of optional parameters
Output
Zend_Service_Yahoo_NewsResultSet
The query return set
Details
visibility
public
final
false
static
false
throws

pageDataSearch

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

Arguments
$query
string
the query being run
$options
array
any optional parameters
Output
Zend_Service_Yahoo_ResultSet
The return set
Details
visibility
public
final
false
static
false
throws

videoSearch

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.

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.

Arguments
$query
string
the query to be run
$options
array
an optional array of query options
Output
Zend_Service_Yahoo_VideoResultSet
the search results
Details
visibility
public
final
false
static
false
throws

webSearch

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.

Arguments
$query
string
the query being run
$options
array
any optional parameters
Output
Zend_Service_Yahoo_WebResultSet
The return set
Details
visibility
public
final
false
static
false
throws
Documentation was generated by DocBlox.