Zend_Service_Technorati provides support for the following
queries:
Cosmos query
lets you see what blogs are linking to a given URL. It returns a
Zend_Service_Technorati_CosmosResultSet
object. For full details please see
Zend_Service_Technorati::cosmos() in the
API reference guide.
Example 830. Cosmos Query
<?php
$technorati = new Zend_Service_Technorati('VALID_API_KEY');
$resultSet = $technorati->cosmos('http://devzone.zend.com/');
echo "<p>Reading " . $resultSet->totalResults() .
" of " . $resultSet->totalResultsAvailable() .
" available results</p>";
echo "<ol>";
foreach ($resultSet as $result) {
echo "<li>" . $result->getWeblog()->getName() . "</li>";
}
echo "</ol>";
The Search
query lets you see what blogs contain a given search string. It returns a Zend_Service_Technorati_SearchResultSet
object. For full details please see
Zend_Service_Technorati::search() in the
API reference guide.
Example 831. Search Query
<?php
$technorati = new Zend_Service_Technorati('VALID_API_KEY');
$resultSet = $technorati->search('zend framework');
echo "<p>Reading " . $resultSet->totalResults() .
" of " . $resultSet->totalResultsAvailable() .
" available results</p>";
echo "<ol>";
foreach ($resultSet as $result) {
echo "<li>" . $result->getWeblog()->getName() . "</li>";
}
echo "</ol>";
The Tag query
lets you see what posts are associated with a given tag. It returns a Zend_Service_Technorati_TagResultSet
object. For full details please see
Zend_Service_Technorati::tag() in the
API reference guide.
Example 832. Tag Query
<?php
$technorati = new Zend_Service_Technorati('VALID_API_KEY');
$resultSet = $technorati->tag('php');
echo "<p>Reading " . $resultSet->totalResults() .
" of " . $resultSet->totalResultsAvailable() .
" available results</p>";
echo "<ol>";
foreach ($resultSet as $result) {
echo "<li>" . $result->getWeblog()->getName() . "</li>";
}
echo "</ol>";
The DailyCounts
query provides daily counts of posts containing the queried keyword. It returns a
Zend_Service_Technorati_DailyCountsResultSet
object. For full details please see
Zend_Service_Technorati::dailyCounts() in the
API reference guide.
Example 833. DailyCounts Query
<?php
$technorati = new Zend_Service_Technorati('VALID_API_KEY');
$resultSet = $technorati->dailyCounts('php');
foreach ($resultSet as $result) {
echo "<li>" . $result->getDate() .
"(" . $result->getCount() . ")</li>";
}
echo "</ol>";
The TopTags
query provides information on top tags indexed by Technorati. It returns a Zend_Service_Technorati_TagsResultSet
object. For full details please see
Zend_Service_Technorati::topTags() in the
API reference guide.
Example 834. TopTags Query
<?php
$technorati = new Zend_Service_Technorati('VALID_API_KEY');
$resultSet = $technorati->topTags();
echo "<p>Reading " . $resultSet->totalResults() .
" of " . $resultSet->totalResultsAvailable() .
" available results</p>";
echo "<ol>";
foreach ($resultSet as $result) {
echo "<li>" . $result->getTag() . "</li>";
}
echo "</ol>";
The BlogInfo
query provides information on what blog, if any, is associated with a given
URL. It returns a Zend_Service_Technorati_BlogInfoResult
object. For full details please see
Zend_Service_Technorati::blogInfo() in the
API reference guide.
Example 835. BlogInfo Query
<?php
$technorati = new Zend_Service_Technorati('VALID_API_KEY');
$result = $technorati->blogInfo('http://devzone.zend.com/');
echo '<h2><a href="' . (string) $result->getWeblog()->getUrl() . '">' .
$result->getWeblog()->getName() . '</a></h2>';
The BlogPostTags
query provides information on the top tags used by a specific blog. It returns a
Zend_Service_Technorati_TagsResultSet
object. For full details please see
Zend_Service_Technorati::blogPostTags() in the
API reference guide.
Example 836. BlogPostTags Query
<?php
$technorati = new Zend_Service_Technorati('VALID_API_KEY');
$resultSet = $technorati->blogPostTags('http://devzone.zend.com/');
echo "<p>Reading " . $resultSet->totalResults() .
" of " . $resultSet->totalResultsAvailable() .
" available results</p>";
echo "<ol>";
foreach ($resultSet as $result) {
echo "<li>" . $result->getTag() . "</li>";
}
echo "</ol>";
The GetInfo
query tells you things that Technorati knows about a member. It returns a Zend_Service_Technorati_GetInfoResult
object. For full details please see
Zend_Service_Technorati::getInfo() in the
API reference guide.
Example 837. GetInfo Query
<?php
$technorati = new Zend_Service_Technorati('VALID_API_KEY');
$result = $technorati->getInfo('weppos');
$author = $result->getAuthor();
echo "<h2>Blogs authored by " . $author->getFirstName() . " " .
$author->getLastName() . "</h2>";
echo "<ol>";
foreach ($result->getWeblogs() as $weblog) {
echo "<li>" . $weblog->getName() . "</li>";
}
echo "</ol>";
The KeyInfo query provides information on daily usage of an API
key. It returns a Zend_Service_Technorati_KeyInfoResult
object. For full details please see
Zend_Service_Technorati::keyInfo() in the
API reference guide.




