Technorati is a blog search engine. By indexing blogs and exploring links between them, they provide tools for monitoring online conversations taking place on and between blogs. By far the richest source of this information is through their REST-based API, to which this module provides an OO PHP interface. Full documentation for Technorati's API is available on their developers' wiki. To use the API you will need an API key.
To protect against future changes to the underlying API it is accessed using a factory method:
$tapi =& Services_Technorati::factory($api_key); |
The Technorati API limits you to 500 queries per day so those wishing to use it in a high-demand environment will want to employ some caching. Services_Technorati provides support for any caching system with a Cache_Lite-like API. To use a cache, you will need to create it and then pass it to the class in the factory:
$tapi =& Services_Technorati::factory($api_key, $cache_object); |
Once you have instantiated the object you can start passing in queries. Each call takes the form of methodName(keyParameter, options) where options is an array.
Таблица 62-1. Query types and their options
Query Name | Key Parameter | Permitted Options |
---|---|---|
cosmos | url | type, limit, start, current, claim, highlight |
search | query keywords | start, limit, claim |
outbound | url | start |
tag | tag | limit, start, format, excerptsize, topexcerptsize |
topTags | - | limit, start |
blogPostTags | url | limit |
getInfo | username | - |
blogInfo | url | - |
The value returned from each query will be either an array representing the unserialized XML or a PEAR Error.
Пример 62-1. An example return from the blogInfo query (for 'jystewart') is:
|
Full details of the XML returned by Technorati is included on the developers' wiki
Пред. | Начало | След. |
Services_Technorati | Уровень выше | Services_W3C_HTML_Validator |
HIVE: All information for read only. Please respect copyright! |