Zend Framework
1.12
|
Public Member Functions | |
__construct ($apiKey) | |
Constructs a new Zend_Service_Technorati instance and setup character encoding. | |
cosmos ($url, $options=null) | |
Cosmos query lets you see what blogs are linking to a given URL. | |
search ($query, $options=null) | |
Search lets you see what blogs contain a given search string. | |
tag ($tag, $options=null) | |
Tag lets you see what posts are associated with a given tag. | |
dailyCounts ($query, $options=null) | |
TopTags provides daily counts of posts containing the queried keyword. | |
topTags ($options=null) | |
TopTags provides information on top tags indexed by Technorati. | |
blogInfo ($url, $options=null) | |
BlogInfo provides information on what blog, if any, is associated with a given URL. | |
blogPostTags ($url, $options=null) | |
BlogPostTags provides information on the top tags used by a specific blog. | |
getInfo ($username, $options=null) | |
GetInfo query tells you things that Technorati knows about a member. | |
keyInfo () | |
KeyInfo query provides information on daily usage of an API key. | |
getApiKey () | |
Returns Technorati API key. | |
getRestClient () | |
Returns a reference to the REST client object in use. | |
setApiKey ($key) | |
Sets Technorati API key. | |
Public Attributes | |
const | API_URI_BASE = 'http://api.technorati.com' |
Base Technorati API URI. | |
const | API_PATH_COSMOS = '/cosmos' |
Query paths. | |
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 |
Prevent magic numbers. | |
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) | |
Validates Cosmos query options. | |
_validateSearch (array $options) | |
Validates Search query options. | |
_validateTag (array $options) | |
Validates Tag query options. | |
_validateDailyCounts (array $options) | |
Validates DailyCounts query options. | |
_validateGetInfo (array $options) | |
Validates GetInfo query options. | |
_validateTopTags (array $options) | |
Validates TopTags query options. | |
_validateBlogInfo (array $options) | |
Validates BlogInfo query options. | |
_validateBlogPostTags (array $options) | |
Validates TopTags query options. | |
_validateInArrayOption ($name, $options, array $array) | |
Checks whether an option is in a given array. | |
_validateMandatoryOption ($name, $options) | |
Checks whether mandatory $name option exists and it's valid. | |
_validateIntegerOption ($name, $options) | |
Checks whether $name option is a valid integer and casts it. | |
_makeRequest ($path, $options=array()) | |
Makes and HTTP GET request to given $path with $options. | |
_validateOptionClaim (array $options) | |
Checks whether 'claim' option value is valid. | |
_validateOptionFormat (array $options) | |
Checks whether 'format' option value is valid. | |
_validateOptionLimit (array $options) | |
Checks whether 'limit' option value is valid. | |
_validateOptionStart (array $options) | |
Checks whether 'start' option value is valid. | |
_validateOptionUrl (array $options) | |
Checks whether 'url' option value exists and is valid. | |
_convertResponseAndCheckContent (Zend_Http_Response $response) | |
Converts $response body to a DOM object and checks it. | |
_compareOptions (array $options, array $validOptions) | |
Checks whether user given options are valid. | |
_prepareOptions ($options, array $defaultOptions) | |
Prepares options for the request. | |
Static Protected Member Functions | |
static | _checkErrors (DomDocument $dom) |
Checks XML response content for errors. | |
static | _checkResponse (Zend_Http_Response $response) |
Checks ReST response for errors. | |
Protected Attributes | |
$_apiKey | |
$_restClient | |
__construct | ( | $apiKey | ) |
Constructs a new Zend_Service_Technorati instance and setup character encoding.
string | $apiKey | Your Technorati API key |
|
staticprotected |
Checks XML response content for errors.
DomDocument | $dom | the XML response as a DOM document |
|
staticprotected |
Checks ReST response for errors.
Zend_Http_Response | $response | the ReST response |
Zend_Service_Technorati_Exception | protected |
|
protected |
Checks whether user given options are valid.
array | $options | user options |
array | $validOptions | valid options |
Zend_Service_Technorati_Exception | protected |
|
protected |
Converts $response body to a DOM object and checks it.
Zend_Http_Response | $response |
Zend_Service_Technorati_Exception | if response content contains an error message protected |
|
protected |
Makes and HTTP GET request to given $path with $options.
HTTP Response is first validated, then returned.
string | $path | |
array | $options |
Zend_Service_Technorati_Exception | on failure protected |
|
protected |
Prepares options for the request.
array | $options | user options |
array | $defaultOptions | default options |
|
protected |
Validates BlogInfo query options.
array | $options |
Zend_Service_Technorati_Exception | protected |
|
protected |
Validates TopTags query options.
array | $options |
Zend_Service_Technorati_Exception | protected |
|
protected |
Validates Cosmos query options.
array | $options |
Zend_Service_Technorati_Exception | protected |
|
protected |
Validates DailyCounts query options.
array | $options |
Zend_Service_Technorati_Exception | protected |
|
protected |
Validates GetInfo query options.
array | $options |
Zend_Service_Technorati_Exception | protected |
|
protected |
Checks whether an option is in a given array.
string | $name | option name |
array | $options | |
array | $array | array of valid options |
Zend_Service_Technorati_Exception | protected |
|
protected |
Checks whether $name option is a valid integer and casts it.
array | $options |
|
protected |
Checks whether mandatory $name option exists and it's valid.
array | $options |
Zend_Service_Technorati_Exception | protected |
|
protected |
Checks whether 'claim' option value is valid.
array | $options |
|
protected |
Checks whether 'format' option value is valid.
Be aware that Zend_Service_Technorati supports only XML as format value.
array | $options |
Zend_Service_Technorati_Exception | if 'format' value != XML protected |
|
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.
array | $options |
Zend_Service_Technorati_Exception | if 'limit' value is invalid protected |
|
protected |
Checks whether 'start' option value is valid.
Value must be an integer greater than 0.
array | $options |
Zend_Service_Technorati_Exception | if 'start' value is invalid protected |
|
protected |
Checks whether 'url' option value exists and is valid.
'url' must be a valid HTTP(s) URL.
array | $options |
Zend_Service_Technorati_Exception | if 'url' value is invalid protected |
|
protected |
Validates Search query options.
array | $options |
Zend_Service_Technorati_Exception | protected |
|
protected |
Validates Tag query options.
array | $options |
Zend_Service_Technorati_Exception | protected |
|
protected |
Validates TopTags query options.
array | $options |
Zend_Service_Technorati_Exception | protected |
blogInfo | ( | $url, | |
$options = null |
|||
) |
BlogInfo provides information on what blog, if any, is associated with a given URL.
string | $url | the URL you are searching for. Prefixes http:// and www. are optional. The URL must be recognized by Technorati as a blog. |
array | $options | additional parameters to refine your query |
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.
string | $url | the URL you are searching for. Prefixes http:// and www. are optional. The URL must be recognized by Technorati as a blog. |
array | $options | additional parameters to refine your query |
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).
string | $url | the URL you are searching for. Prefixes http:// and www. are optional. |
array | $options | additional parameters to refine your query |
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
string | $q | the keyword query |
array | $options | additional parameters to refine your query |
getApiKey | ( | ) |
Returns Technorati API key.
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.
string | $username | the Technorati user name you are searching for |
array | $options | additional parameters to refine your query |
getRestClient | ( | ) |
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.
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.
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:
string | $query | the words you are searching for. |
array | $options | additional parameters to refine your query |
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.
string | $key | Technorati API Key |
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.
string | $tag | the tag term you are searching posts for. |
array | $options | additional parameters to refine your query |
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.
array | $options | additional parameters to refine your query |
|
protected |
|
protected |
const API_PATH_BLOGINFO = '/bloginfo' |
const API_PATH_BLOGPOSTTAGS = '/blogposttags' |
const API_PATH_COSMOS = '/cosmos' |
Query paths.
const API_PATH_DAILYCOUNTS = '/dailycounts' |
const API_PATH_GETINFO = '/getinfo' |
const API_PATH_KEYINFO = '/keyinfo' |
const API_PATH_SEARCH = '/search' |
const API_PATH_TAG = '/tag' |
const API_PATH_TOPTAGS = '/toptags' |
const API_URI_BASE = 'http://api.technorati.com' |
Base Technorati API URI.
const PARAM_DAYS_MAX_VALUE = 180 |
const PARAM_DAYS_MIN_VALUE = 1 |
const PARAM_LIMIT_MAX_VALUE = 100 |
const PARAM_LIMIT_MIN_VALUE = 1 |
Prevent magic numbers.
const PARAM_START_MIN_VALUE = 1 |