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

Public Member Functions

 __construct ($apiKey)
 cosmos ($url, $options=null)
 search ($query, $options=null)
 tag ($tag, $options=null)
 dailyCounts ($query, $options=null)
 topTags ($options=null)
 blogInfo ($url, $options=null)
 blogPostTags ($url, $options=null)
 getInfo ($username, $options=null)
 keyInfo ()
 getApiKey ()
 getRestClient ()
 setApiKey ($key)

Data Fields

const API_URI_BASE = 'http://api.technorati.com'
const API_PATH_COSMOS = '/cosmos'
const API_PATH_SEARCH = '/search'
const API_PATH_TAG = '/tag'
const API_PATH_DAILYCOUNTS = '/dailycounts'
const API_PATH_TOPTAGS = '/toptags'
const API_PATH_BLOGINFO = '/bloginfo'
const API_PATH_BLOGPOSTTAGS = '/blogposttags'
const API_PATH_GETINFO = '/getinfo'
const API_PATH_KEYINFO = '/keyinfo'
const PARAM_LIMIT_MIN_VALUE = 1
const PARAM_LIMIT_MAX_VALUE = 100
const PARAM_DAYS_MIN_VALUE = 1
const PARAM_DAYS_MAX_VALUE = 180
const PARAM_START_MIN_VALUE = 1

Protected Member Functions

 _validateCosmos (array $options)
 _validateSearch (array $options)
 _validateTag (array $options)
 _validateDailyCounts (array $options)
 _validateGetInfo (array $options)
 _validateTopTags (array $options)
 _validateBlogInfo (array $options)
 _validateBlogPostTags (array $options)
 _validateInArrayOption ($name, $options, array $array)
 _validateMandatoryOption ($name, $options)
 _validateIntegerOption ($name, $options)
 _makeRequest ($path, $options=array())
 _validateOptionClaim (array $options)
 _validateOptionFormat (array $options)
 _validateOptionLimit (array $options)
 _validateOptionStart (array $options)
 _validateOptionUrl (array $options)
 _convertResponseAndCheckContent (Zend_Http_Response $response)
 _compareOptions (array $options, array $validOptions)
 _prepareOptions ($options, array $defaultOptions)

Static Protected Member Functions

static _checkErrors (DomDocument $dom)
static _checkResponse (Zend_Http_Response $response)

Protected Attributes

 $_apiKey
 $_restClient

Detailed Description

Definition at line 38 of file Technorati.php.


Constructor & Destructor Documentation

__construct ( apiKey)

Constructs a new Zend_Service_Technorati instance and setup character encoding.

Parameters:
string$apiKeyYour Technorati API key

Definition at line 85 of file Technorati.php.


Member Function Documentation

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

Checks XML response content for errors.

Parameters:
DomDocument$domthe XML response as a DOM document
Returns:
void
Exceptions:
Zend_Service_Technorati_ExceptionTechnorati API: Error response protected
See also:
Zend_Service_Technorati_Exception

Definition at line 938 of file Technorati.php.

Here is the caller graph for this function:

static _checkResponse ( Zend_Http_Response response) [static, protected]

Checks ReST response for errors.

Parameters:
Zend_Http_Response$responsethe ReST response
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionprotected
See also:
Zend_Service_Technorati_Exception

Definition at line 977 of file Technorati.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_compareOptions ( array options,
array validOptions 
) [protected]

Checks whether user given options are valid.

Parameters:
array$optionsuser options
array$validOptionsvalid options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionprotected
See also:
Zend_Service_Technorati_Exception

Definition at line 999 of file Technorati.php.

Here is the caller graph for this function:

Converts $response body to a DOM object and checks it.

Parameters:
Zend_Http_Response$response
Returns:
DOMDocument
Exceptions:
Zend_Service_Technorati_Exceptionif response content contains an error message protected

Definition at line 961 of file Technorati.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_makeRequest ( path,
options = array() 
) [protected]

Makes and HTTP GET request to given $path with $options. HTTP Response is first validated, then returned.

Parameters:
string$path
array$options
Returns:
Zend_Http_Response
Exceptions:
Zend_Service_Technorati_Exceptionon failure protected

Definition at line 821 of file Technorati.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_prepareOptions ( options,
array defaultOptions 
) [protected]

Prepares options for the request

Parameters:
array$optionsuser options
array$defaultOptionsdefault options
Returns:
array Merged array of user and default/required options. protected

Definition at line 1021 of file Technorati.php.

Here is the caller graph for this function:

_validateBlogInfo ( array options) [protected]

Validates BlogInfo query options.

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionprotected

Definition at line 717 of file Technorati.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateBlogPostTags ( array options) [protected]

Validates TopTags query options.

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionprotected

Definition at line 738 of file Technorati.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateCosmos ( array options) [protected]

Validates Cosmos query options.

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionprotected

Definition at line 543 of file Technorati.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateDailyCounts ( array options) [protected]

Validates DailyCounts query options.

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionprotected
See also:
Zend_Service_Technorati_Exception

Definition at line 639 of file Technorati.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateGetInfo ( array options) [protected]

Validates GetInfo query options.

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionprotected

Definition at line 673 of file Technorati.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateInArrayOption ( name,
options,
array array 
) [protected]

Checks whether an option is in a given array.

Parameters:
string$nameoption name
array$options
array$arrayarray of valid options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionprotected
See also:
Zend_Service_Technorati_Exception

Definition at line 765 of file Technorati.php.

Here is the caller graph for this function:

_validateIntegerOption ( name,
options 
) [protected]

Checks whether $name option is a valid integer and casts it.

Parameters:
array$options
Returns:
void protected

Definition at line 804 of file Technorati.php.

Here is the caller graph for this function:

_validateMandatoryOption ( name,
options 
) [protected]

Checks whether mandatory $name option exists and it's valid.

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionprotected
See also:
Zend_Service_Technorati_Exception

Definition at line 785 of file Technorati.php.

Here is the caller graph for this function:

_validateOptionClaim ( array options) [protected]

Checks whether 'claim' option value is valid.

Parameters:
array$options
Returns:
void protected

Definition at line 837 of file Technorati.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateOptionFormat ( array options) [protected]

Checks whether 'format' option value is valid. Be aware that Zend_Service_Technorati supports only XML as format value.

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionif 'format' value != XML protected
See also:
Zend_Service_Technorati_Exception

Definition at line 851 of file Technorati.php.

Here is the caller graph for this function:

_validateOptionLimit ( array options) [protected]

Checks whether 'limit' option value is valid. Value must be an integer greater than PARAM_LIMIT_MIN_VALUE and lower than PARAM_LIMIT_MAX_VALUE.

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionif 'limit' value is invalid protected
See also:
Zend_Service_Technorati_Exception

Definition at line 874 of file Technorati.php.

Here is the caller graph for this function:

_validateOptionStart ( array options) [protected]

Checks whether 'start' option value is valid. Value must be an integer greater than 0.

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionif 'start' value is invalid protected
See also:
Zend_Service_Technorati_Exception

Definition at line 899 of file Technorati.php.

Here is the caller graph for this function:

_validateOptionUrl ( array options) [protected]

Checks whether 'url' option value exists and is valid. 'url' must be a valid HTTP(s) URL.

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionif 'url' value is invalid protected
Todo:
support for Zend_Uri_Http

Definition at line 924 of file Technorati.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateSearch ( array options) [protected]

Validates Search query options.

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionprotected

Definition at line 580 of file Technorati.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateTag ( array options) [protected]

Validates Tag query options.

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionprotected

Definition at line 609 of file Technorati.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_validateTopTags ( array options) [protected]

Validates TopTags query options.

Parameters:
array$options
Returns:
void
Exceptions:
Zend_Service_Technorati_Exceptionprotected

Definition at line 694 of file Technorati.php.

Here is the call graph for this function:

Here is the caller graph for this function:

blogInfo ( url,
options = null 
)

BlogInfo provides information on what blog, if any, is associated with a given URL.

Parameters:
string$urlthe URL you are searching for. Prefixes http:// and www. are optional. The URL must be recognized by Technorati as a blog.
array$optionsadditional parameters to refine your query
Returns:
Zend_Service_Technorati_BlogInfoResult
Exceptions:
Zend_Service_Technorati_ExceptionTechnorati API: BlogInfo Query reference
See also:
Zend_Service_Technorati_BlogInfoResult

Definition at line 360 of file Technorati.php.

Here is the call graph for this function:

blogPostTags ( url,
options = null 
)

BlogPostTags provides information on the top tags used by a specific blog.

Query options include:

'limit' => (int) optional - adjust the size of your result from the default value of 20 to between 1 and 100 results. 'start' => (int) optional - adjust the range of your result set. Set this number to larger than zero and you will receive the portion of Technorati's total result set ranging from start to start+limit. The default start value is 1. Note. This property is not documented.

Parameters:
string$urlthe URL you are searching for. Prefixes http:// and www. are optional. The URL must be recognized by Technorati as a blog.
array$optionsadditional parameters to refine your query
Returns:
Zend_Service_Technorati_TagsResultSet
Exceptions:
Zend_Service_Technorati_ExceptionTechnorati API: BlogPostTags Query reference
See also:
Zend_Service_Technorati_TagsResultSet

Definition at line 401 of file Technorati.php.

Here is the call graph for this function:

cosmos ( url,
options = null 
)

Cosmos query lets you see what blogs are linking to a given URL.

On the Technorati site, you can enter a URL in the searchbox and it will return a list of blogs linking to it. The API version allows more features and gives you a way to use the cosmos on your own site.

Query options include:

'type' => (link|weblog) optional - A value of link returns the freshest links referencing your target URL. A value of weblog returns the last set of unique weblogs referencing your target URL. 'limit' => (int) optional - adjust the size of your result from the default value of 20 to between 1 and 100 results. 'start' => (int) optional - adjust the range of your result set. Set this number to larger than zero and you will receive the portion of Technorati's total result set ranging from start to start+limit. The default start value is 1. 'current' => (true|false) optional - the default setting of true Technorati returns links that are currently on a weblog's homepage. Set this parameter to false if you would like to receive all links to the given URL regardless of their current placement on the source blog. Internally the value is converted in (yes|no). 'claim' => (true|false) optional - the default setting of FALSE returns no user information about each weblog included in the result set when available. Set this parameter to FALSE to include Technorati member data in the result set when a weblog in your result set has been successfully claimed by a member of Technorati. Internally the value is converted in (int). 'highlight' => (true|false) optional - the default setting of TRUE highlights the citation of the given URL within the weblog excerpt. Set this parameter to FALSE to apply no special markup to the blog excerpt. Internally the value is converted in (int).

Parameters:
string$urlthe URL you are searching for. Prefixes http:// and www. are optional.
array$optionsadditional parameters to refine your query
Returns:
Zend_Service_Technorati_CosmosResultSet
Exceptions:
Zend_Service_Technorati_ExceptionTechnorati API: Cosmos Query reference
See also:
Zend_Service_Technorati_CosmosResultSet

Definition at line 141 of file Technorati.php.

Here is the call graph for this function:

dailyCounts ( query,
options = null 
)

TopTags provides daily counts of posts containing the queried keyword.

Query options include:

'days' => (int) optional - Used to specify the number of days in the past to request daily count data for. Can be any integer between 1 and 180, default is 180

Parameters:
string$qthe keyword query
array$optionsadditional parameters to refine your query
Returns:
Zend_Service_Technorati_DailyCountsResultSet
Exceptions:
Zend_Service_Technorati_ExceptionTechnorati API: DailyCounts Query reference
See also:
Zend_Service_Technorati_DailyCountsResultSet

Definition at line 292 of file Technorati.php.

Here is the call graph for this function:

getApiKey ( )

Returns Technorati API key.

Returns:
string Technorati API key

Definition at line 490 of file Technorati.php.

getInfo ( username,
options = null 
)

GetInfo query tells you things that Technorati knows about a member.

The returned info is broken up into two sections: The first part describes some information that the user wants to allow people to know about him- or herself. The second part of the document is a listing of the weblogs that the user has successfully claimed and the information that Technorati knows about these weblogs.

Parameters:
string$usernamethe Technorati user name you are searching for
array$optionsadditional parameters to refine your query
Returns:
Zend_Service_Technorati_GetInfoResult
Exceptions:
Zend_Service_Technorati_ExceptionTechnorati API: GetInfo reference
See also:
Zend_Service_Technorati_GetInfoResult

Definition at line 438 of file Technorati.php.

Here is the call graph for this function:

Returns a reference to the REST client object in use.

If the reference hasn't being inizialized yet, then a new Zend_Rest_Client instance is created.

Returns:
Zend_Rest_Client
See also:
Zend_Rest_Client

Definition at line 503 of file Technorati.php.

Here is the caller graph for this function:

keyInfo ( )

KeyInfo query provides information on daily usage of an API key. Key Info Queries do not count against a key's daily query limit.

A day is defined as 00:00-23:59 Pacific time.

Returns:
Zend_Service_Technorati_KeyInfoResult
Exceptions:
Zend_Service_Technorati_ExceptionTechnorati API: Key Info reference
See also:
Zend_Service_Technorati_KeyInfoResult

Definition at line 466 of file Technorati.php.

Here is the call graph for this function:

search ( query,
options = null 
)

Search lets you see what blogs contain a given search string.

Query options include:

'language' => (string) optional - a ISO 639-1 two character language code to retrieve results specific to that language. This feature is currently beta and may not work for all languages. 'authority' => (n|a1|a4|a7) optional - filter results to those from blogs with at least the Technorati Authority specified. Technorati calculates a blog's authority by how many people link to it. Filtering by authority is a good way to refine your search results. There are four settings:

  • n => Any authority: All results.
  • a1 => A little authority: Results from blogs with at least one link.
  • a4 => Some authority: Results from blogs with a handful of links.
  • a7 => A lot of authority: Results from blogs with hundreds of links. 'limit' => (int) optional - adjust the size of your result from the default value of 20 to between 1 and 100 results. 'start' => (int) optional - adjust the range of your result set. Set this number to larger than zero and you will receive the portion of Technorati's total result set ranging from start to start+limit. The default start value is 1. 'claim' => (true|false) optional - the default setting of FALSE returns no user information about each weblog included in the result set when available. Set this parameter to FALSE to include Technorati member data in the result set when a weblog in your result set has been successfully claimed by a member of Technorati. Internally the value is converted in (int).
Parameters:
string$querythe words you are searching for.
array$optionsadditional parameters to refine your query
Returns:
Zend_Service_Technorati_SearchResultSet
Exceptions:
Zend_Service_Technorati_ExceptionTechnorati API: Search Query reference
See also:
Zend_Service_Technorati_SearchResultSet

Definition at line 207 of file Technorati.php.

Here is the call graph for this function:

setApiKey ( key)

Sets Technorati API key.

Be aware that this function doesn't validate the key. The key is validated as soon as the first API request is sent. If the key is invalid, the API request method will throw a Zend_Service_Technorati_Exception exception with Invalid Key message.

Parameters:
string$keyTechnorati API Key
Returns:
void How to get your Technorati API Key

Definition at line 528 of file Technorati.php.

tag ( tag,
options = null 
)

Tag lets you see what posts are associated with a given tag.

Query options include:

'limit' => (int) optional - adjust the size of your result from the default value of 20 to between 1 and 100 results. 'start' => (int) optional - adjust the range of your result set. Set this number to larger than zero and you will receive the portion of Technorati's total result set ranging from start to start+limit. The default start value is 1. 'excerptsize' => (int) optional - number of word characters to include in the post excerpts. By default 100 word characters are returned. 'topexcerptsize' => (int) optional - number of word characters to include in the first post excerpt. By default 150 word characters are returned.

Parameters:
string$tagthe tag term you are searching posts for.
array$optionsadditional parameters to refine your query
Returns:
Zend_Service_Technorati_TagResultSet
Exceptions:
Zend_Service_Technorati_ExceptionTechnorati API: Tag Query reference
See also:
Zend_Service_Technorati_TagResultSet

Definition at line 254 of file Technorati.php.

Here is the call graph for this function:

topTags ( options = null)

TopTags provides information on top tags indexed by Technorati.

Query options include:

'limit' => (int) optional - adjust the size of your result from the default value of 20 to between 1 and 100 results. 'start' => (int) optional - adjust the range of your result set. Set this number to larger than zero and you will receive the portion of Technorati's total result set ranging from start to start+limit. The default start value is 1.

Parameters:
array$optionsadditional parameters to refine your query
Returns:
Zend_Service_Technorati_TagsResultSet
Exceptions:
Zend_Service_Technorati_ExceptionTechnorati API: TopTags Query reference
See also:
Zend_Service_Technorati_TagsResultSet

Definition at line 331 of file Technorati.php.

Here is the call graph for this function:


Field Documentation

$_apiKey [protected]

Definition at line 68 of file Technorati.php.

$_restClient [protected]

Definition at line 76 of file Technorati.php.

const API_PATH_BLOGINFO = '/bloginfo'

Definition at line 49 of file Technorati.php.

const API_PATH_BLOGPOSTTAGS = '/blogposttags'

Definition at line 50 of file Technorati.php.

const API_PATH_COSMOS = '/cosmos'

Query paths

Definition at line 44 of file Technorati.php.

const API_PATH_DAILYCOUNTS = '/dailycounts'

Definition at line 47 of file Technorati.php.

const API_PATH_GETINFO = '/getinfo'

Definition at line 51 of file Technorati.php.

const API_PATH_KEYINFO = '/keyinfo'

Definition at line 52 of file Technorati.php.

const API_PATH_SEARCH = '/search'

Definition at line 45 of file Technorati.php.

const API_PATH_TAG = '/tag'

Definition at line 46 of file Technorati.php.

const API_PATH_TOPTAGS = '/toptags'

Definition at line 48 of file Technorati.php.

const API_URI_BASE = 'http://api.technorati.com'

Base Technorati API URI

Definition at line 41 of file Technorati.php.

const PARAM_DAYS_MAX_VALUE = 180

Definition at line 58 of file Technorati.php.

Definition at line 57 of file Technorati.php.

const PARAM_LIMIT_MAX_VALUE = 100

Definition at line 56 of file Technorati.php.

Prevent magic numbers

Definition at line 55 of file Technorati.php.

Definition at line 59 of file Technorati.php.


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