PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Making Your First Query

In order to run a query, first you need a Zend_Service_Technorati instance with a valid API key. Then choose one of the available query methods, and call it providing required arguments.

Example 845. Sending your first query

<?php
// create a new Zend_Service_Technorati
// with a valid API_KEY
$technorati = new Zend_Service_Technorati('VALID_API_KEY');

// search Technorati for PHP keyword
$resultSet $technorati->search('PHP');

Each query method accepts an array of optional parameters that can be used to refine your query.

Example 846. Refining your query

<?php
// create a new Zend_Service_Technorati
// with a valid API_KEY
$technorati = new Zend_Service_Technorati('VALID_API_KEY');

// filter your query including only results
// with some authority (Results from blogs with a handful of links)
$options = array('authority' => 'a4');

// search Technorati for PHP keyword
$resultSet $technorati->search('PHP'$options);

A Zend_Service_Technorati instance is not a single-use object. That is, you don't need to create a new instance for each query call; simply use your current Zend_Service_Technorati object as long as you need it.

Example 847. Sending multiple queries with the same Zend_Service_Technorati instance

<?php
// create a new Zend_Service_Technorati
// with a valid API_KEY
$technorati = new Zend_Service_Technorati('VALID_API_KEY');

// search Technorati for PHP keyword
$search $technorati->search('PHP');

// get top tags indexed by Technorati
$topTags $technorati->topTags();

Zend Framework