Zend_Service_Technorati.xml 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.service.technorati">
  4. <title>Zend_Service_Technorati</title>
  5. <sect2 id="zend.service.technorati.introduction">
  6. <title>Introduction</title>
  7. <para>
  8. <classname>Zend_Service_Technorati</classname> provides an easy, intuitive and object-oriented interface for using
  9. the Technorati <acronym>API</acronym>. It provides access to all available
  10. <ulink url="http://technorati.com/developers/api/">Technorati <acronym>API</acronym> queries</ulink>
  11. and returns the original <acronym>XML</acronym> response as a friendly <acronym>PHP</acronym> object.
  12. </para>
  13. <para>
  14. <ulink url="http://technorati.com/">Technorati</ulink> is one of the most popular blog search engines.
  15. The <acronym>API</acronym> interface enables developers to retrieve information about a specific blog, search blogs matching a
  16. single tag or phrase and get information about a specific author (blogger). For a full list of available
  17. queries please see the
  18. <ulink url="http://technorati.com/developers/api/">Technorati <acronym>API</acronym> documentation</ulink>
  19. or the <link linkend="zend.service.technorati.queries">Available Technorati queries</link> section of this
  20. document.
  21. </para>
  22. </sect2>
  23. <sect2 id="zend.service.technorati.getting-started">
  24. <title>Getting Started</title>
  25. <para>
  26. Technorati requires a valid <acronym>API</acronym> key for usage. To get your own <acronym>API</acronym> Key you first need to
  27. <ulink url="http://technorati.com/signup/">create a new Technorati account</ulink>, then visit the
  28. <ulink url="http://technorati.com/developers/apikey.html">API Key section</ulink>.
  29. </para>
  30. <note>
  31. <title>API Key limits</title>
  32. <para>
  33. You can make up to 500 Technorati <acronym>API</acronym> calls per day, at no charge.
  34. Other usage limitations may apply, depending on the current Technorati <acronym>API</acronym> license.
  35. </para>
  36. </note>
  37. <para>
  38. Once you have a valid <acronym>API</acronym> key, you're ready to start using <classname>Zend_Service_Technorati</classname>.
  39. </para>
  40. </sect2>
  41. <sect2 id="zend.service.technorati.making-first-query">
  42. <title>Making Your First Query</title>
  43. <para>
  44. In order to run a query, first you need a <classname>Zend_Service_Technorati</classname> instance with a valid <acronym>API</acronym>
  45. key. Then choose one of the available query methods, and call it providing required arguments.
  46. </para>
  47. <example id="zend.service.technorati.making-first-query.example-1">
  48. <title>Sending your first query</title>
  49. <programlisting language="php"><![CDATA[
  50. // create a new Zend_Service_Technorati
  51. // with a valid API_KEY
  52. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  53. // search Technorati for PHP keyword
  54. $resultSet = $technorati->search('PHP');
  55. ]]></programlisting>
  56. </example>
  57. <para>
  58. Each query method accepts an array of optional parameters that can be used to refine your query.
  59. </para>
  60. <example id="zend.service.technorati.making-first-query.example-2">
  61. <title>Refining your query</title>
  62. <programlisting language="php"><![CDATA[
  63. // create a new Zend_Service_Technorati
  64. // with a valid API_KEY
  65. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  66. // filter your query including only results
  67. // with some authority (Results from blogs with a handful of links)
  68. $options = array('authority' => 'a4');
  69. // search Technorati for PHP keyword
  70. $resultSet = $technorati->search('PHP', $options);
  71. ]]></programlisting>
  72. </example>
  73. <para>
  74. A <classname>Zend_Service_Technorati</classname> instance is not a single-use object. That is, you don't need to
  75. create a new instance for each query call; simply use your current <classname>Zend_Service_Technorati</classname>
  76. object as long as you need it.
  77. </para>
  78. <example id="zend.service.technorati.making-first-query.example-3">
  79. <title>Sending multiple queries with the same Zend_Service_Technorati instance</title>
  80. <programlisting language="php"><![CDATA[
  81. // create a new Zend_Service_Technorati
  82. // with a valid API_KEY
  83. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  84. // search Technorati for PHP keyword
  85. $search = $technorati->search('PHP');
  86. // get top tags indexed by Technorati
  87. $topTags = $technorati->topTags();
  88. ]]></programlisting>
  89. </example>
  90. </sect2>
  91. <sect2 id="zend.service.technorati.consuming-results">
  92. <title>Consuming Results</title>
  93. <para>
  94. You can get one of two types of result object in response to a query.
  95. </para>
  96. <para>
  97. The first group is represented by <classname>Zend_Service_Technorati_*ResultSet</classname> objects. A result set
  98. object is basically a collection of result objects. It extends the basic
  99. <classname>Zend_Service_Technorati_ResultSet</classname> class and implements the <code>SeekableIterator</code> <acronym>PHP</acronym>
  100. interface. The best way to consume a result set object is to loop over it with the <acronym>PHP</acronym> <code>foreach</code>
  101. statement.
  102. </para>
  103. <example id="zend.service.technorati.consuming-results.example-1">
  104. <title>Consuming a result set object</title>
  105. <programlisting language="php"><![CDATA[
  106. // create a new Zend_Service_Technorati
  107. // with a valid API_KEY
  108. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  109. // search Technorati for PHP keyword
  110. // $resultSet is an instance of Zend_Service_Technorati_SearchResultSet
  111. $resultSet = $technorati->search('PHP');
  112. // loop over all result objects
  113. foreach ($resultSet as $result) {
  114. // $result is an instance of Zend_Service_Technorati_SearchResult
  115. }
  116. ]]></programlisting>
  117. </example>
  118. <para>
  119. Because <classname>Zend_Service_Technorati_ResultSet</classname> implements the <code>SeekableIterator</code>
  120. interface, you can seek a specific result object using its position in the result collection.
  121. </para>
  122. <example id="zend.service.technorati.consuming-results.example-2">
  123. <title>Seeking a specific result set object</title>
  124. <programlisting language="php"><![CDATA[
  125. // create a new Zend_Service_Technorati
  126. // with a valid API_KEY
  127. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  128. // search Technorati for PHP keyword
  129. // $resultSet is an instance of Zend_Service_Technorati_SearchResultSet
  130. $resultSet = $technorati->search('PHP');
  131. // $result is an instance of Zend_Service_Technorati_SearchResult
  132. $resultSet->seek(1);
  133. $result = $resultSet->current();
  134. ]]></programlisting>
  135. </example>
  136. <note>
  137. <para>
  138. <code>SeekableIterator</code> works as an array and counts positions starting from index 0. Fetching
  139. position number 1 means getting the second result in the collection.
  140. </para>
  141. </note>
  142. <para>
  143. The second group is represented by special standalone result objects.
  144. <classname>Zend_Service_Technorati_GetInfoResult</classname>, <classname>Zend_Service_Technorati_BlogInfoResult</classname> and
  145. <classname>Zend_Service_Technorati_KeyInfoResult</classname> act as wrappers for additional objects, such as
  146. <classname>Zend_Service_Technorati_Author</classname> and <classname>Zend_Service_Technorati_Weblog</classname>.
  147. </para>
  148. <example id="zend.service.technorati.consuming-results.example-3">
  149. <title>Consuming a standalone result object</title>
  150. <programlisting language="php"><![CDATA[
  151. // create a new Zend_Service_Technorati
  152. // with a valid API_KEY
  153. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  154. // get info about weppos author
  155. $result = $technorati->getInfo('weppos');
  156. $author = $result->getAuthor();
  157. echo '<h2>Blogs authored by ' . $author->getFirstName() . " " .
  158. $author->getLastName() . '</h2>';
  159. echo '<ol>';
  160. foreach ($result->getWeblogs() as $weblog) {
  161. echo '<li>' . $weblog->getName() . '</li>';
  162. }
  163. echo "</ol>";
  164. ]]></programlisting>
  165. </example>
  166. <para>
  167. Please read the <link linkend="zend.service.technorati.classes">Zend_Service_Technorati Classes</link>
  168. section for further details about response classes.
  169. </para>
  170. </sect2>
  171. <sect2 id="zend.service.technorati.handling-errors">
  172. <title>Handling Errors</title>
  173. <para>
  174. Each <classname>Zend_Service_Technorati</classname> query method throws a
  175. <classname>Zend_Service_Technorati_Exception</classname> exception on failure with a meaningful error message.
  176. </para>
  177. <para>
  178. There are several reasons that may cause a <classname>Zend_Service_Technorati</classname> query to fail.
  179. <classname>Zend_Service_Technorati</classname> validates all parameters for any query request. If a parameter is
  180. invalid or it contains an invalid value, a new <classname>Zend_Service_Technorati_Exception</classname> exception is
  181. thrown. Additionally, the Technorati <acronym>API</acronym> interface could be temporally unavailable, or it could return a
  182. response that is not well formed.
  183. </para>
  184. <para>
  185. You should always wrap a Technorati query with a <code>try</code>...<code>catch</code> block.
  186. </para>
  187. <example id="zend.service.technorati.handling-errors.example-1">
  188. <title>Handling a Query Exception</title>
  189. <programlisting language="php"><![CDATA[
  190. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  191. try {
  192. $resultSet = $technorati->search('PHP');
  193. } catch(Zend_Service_Technorati_Exception $e) {
  194. echo "An error occurred: " $e->getMessage();
  195. }
  196. ]]></programlisting>
  197. </example>
  198. </sect2>
  199. <sect2 id="zend.service.technorati.checking-api-daily-usage">
  200. <title>Checking Your API Key Daily Usage</title>
  201. <para>
  202. From time to time you probably will want to check your <acronym>API</acronym> key daily usage. By default Technorati limits
  203. your <acronym>API</acronym> usage to 500 calls per day, and an exception is returned by <classname>Zend_Service_Technorati</classname>
  204. if you try to use it beyond this limit. You can get information about your <acronym>API</acronym> key usage using the
  205. <methodname>Zend_Service_Technorati::keyInfo()</methodname> method.
  206. </para>
  207. <para>
  208. <methodname>Zend_Service_Technorati::keyInfo()</methodname> returns a
  209. <classname>Zend_Service_Technorati_KeyInfoResult</classname> object. For full details please see the
  210. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  211. </para>
  212. <example id="zend.service.technorati.checking-api-daily-usage.example-1">
  213. <title>Getting API key daily usage information</title>
  214. <programlisting language="php"><![CDATA[
  215. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  216. $key = $technorati->keyInfo();
  217. echo "API Key: " . $key->getApiKey() . "<br />";
  218. echo "Daily Usage: " . $key->getApiQueries() . "/" .
  219. $key->getMaxQueries() . "<br />";
  220. ]]></programlisting>
  221. </example>
  222. </sect2>
  223. <sect2 id="zend.service.technorati.queries">
  224. <title>Available Technorati Queries</title>
  225. <para>
  226. <classname>Zend_Service_Technorati</classname> provides support for the following queries:
  227. <itemizedlist>
  228. <listitem><para><link linkend="zend.service.technorati.queries.cosmos"><code>Cosmos</code></link></para></listitem>
  229. <listitem><para><link linkend="zend.service.technorati.queries.search"><code>Search</code></link></para></listitem>
  230. <listitem><para><link linkend="zend.service.technorati.queries.tag"><code>Tag</code></link></para></listitem>
  231. <listitem><para><link linkend="zend.service.technorati.queries.dailycounts"><code>DailyCounts</code></link></para></listitem>
  232. <listitem><para><link linkend="zend.service.technorati.queries.toptags"><code>TopTags</code></link></para></listitem>
  233. <listitem><para><link linkend="zend.service.technorati.queries.bloginfo"><code>BlogInfo</code></link></para></listitem>
  234. <listitem><para><link linkend="zend.service.technorati.queries.blogposttags"><code>BlogPostTags</code></link></para></listitem>
  235. <listitem><para><link linkend="zend.service.technorati.queries.getinfo"><code>GetInfo</code></link></para></listitem>
  236. </itemizedlist>
  237. </para>
  238. <sect3 id="zend.service.technorati.queries.cosmos">
  239. <title>Technorati Cosmos</title>
  240. <para>
  241. <ulink url="http://technorati.com/developers/api/cosmos.html">Cosmos</ulink> query lets you see what
  242. blogs are linking to a given <acronym>URL</acronym>. It returns a
  243. <link linkend="zend.service.technorati.classes.cosmosresultset"><classname>Zend_Service_Technorati_CosmosResultSet</classname></link>
  244. object. For full details please see <methodname>Zend_Service_Technorati::cosmos()</methodname> in the
  245. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  246. </para>
  247. <example id="zend.service.technorati.queries.cosmos.example-1">
  248. <title>Cosmos Query</title>
  249. <programlisting language="php"><![CDATA[
  250. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  251. $resultSet = $technorati->cosmos('http://devzone.zend.com/');
  252. echo "<p>Reading " . $resultSet->totalResults() .
  253. " of " . $resultSet->totalResultsAvailable() .
  254. " available results</p>";
  255. echo "<ol>";
  256. foreach ($resultSet as $result) {
  257. echo "<li>" . $result->getWeblog()->getName() . "</li>";
  258. }
  259. echo "</ol>";
  260. ]]></programlisting>
  261. </example>
  262. </sect3>
  263. <sect3 id="zend.service.technorati.queries.search">
  264. <title>Technorati Search</title>
  265. <para>
  266. The <ulink url="http://technorati.com/developers/api/search.html">Search</ulink> query lets you see
  267. what blogs contain a given search string. It returns a
  268. <link linkend="zend.service.technorati.classes.searchresultset"><classname>Zend_Service_Technorati_SearchResultSet</classname></link>
  269. object. For full details please see <methodname>Zend_Service_Technorati::search()</methodname> in the
  270. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  271. </para>
  272. <example id="zend.service.technorati.queries.search.example-1">
  273. <title>Search Query</title>
  274. <programlisting language="php"><![CDATA[
  275. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  276. $resultSet = $technorati->search('zend framework');
  277. echo "<p>Reading " . $resultSet->totalResults() .
  278. " of " . $resultSet->totalResultsAvailable() .
  279. " available results</p>";
  280. echo "<ol>";
  281. foreach ($resultSet as $result) {
  282. echo "<li>" . $result->getWeblog()->getName() . "</li>";
  283. }
  284. echo "</ol>";
  285. ]]></programlisting>
  286. </example>
  287. </sect3>
  288. <sect3 id="zend.service.technorati.queries.tag">
  289. <title>Technorati Tag</title>
  290. <para>
  291. The <ulink url="http://technorati.com/developers/api/tag.html">Tag</ulink> query lets you see what
  292. posts are associated with a given tag. It returns a
  293. <link linkend="zend.service.technorati.classes.tagresultset"><classname>Zend_Service_Technorati_TagResultSet</classname></link>
  294. object. For full details please see <methodname>Zend_Service_Technorati::tag()</methodname> in the
  295. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  296. </para>
  297. <example id="zend.service.technorati.queries.tag.example-1">
  298. <title>Tag Query</title>
  299. <programlisting language="php"><![CDATA[
  300. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  301. $resultSet = $technorati->tag('php');
  302. echo "<p>Reading " . $resultSet->totalResults() .
  303. " of " . $resultSet->totalResultsAvailable() .
  304. " available results</p>";
  305. echo "<ol>";
  306. foreach ($resultSet as $result) {
  307. echo "<li>" . $result->getWeblog()->getName() . "</li>";
  308. }
  309. echo "</ol>";
  310. ]]></programlisting>
  311. </example>
  312. </sect3>
  313. <sect3 id="zend.service.technorati.queries.dailycounts">
  314. <title>Technorati DailyCounts</title>
  315. <para>
  316. The <ulink url="http://technorati.com/developers/api/dailycounts.html">DailyCounts</ulink> query
  317. provides daily counts of posts containing the queried keyword. It returns a
  318. <link linkend="zend.service.technorati.classes.dailycountsresultset"><classname>Zend_Service_Technorati_DailyCountsResultSet</classname></link>
  319. object. For full details please see <methodname>Zend_Service_Technorati::dailyCounts()</methodname> in the
  320. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  321. </para>
  322. <example id="zend.service.technorati.queries.dailycounts.example-1">
  323. <title>DailyCounts Query</title>
  324. <programlisting language="php"><![CDATA[
  325. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  326. $resultSet = $technorati->dailyCounts('php');
  327. foreach ($resultSet as $result) {
  328. echo "<li>" . $result->getDate() .
  329. "(" . $result->getCount() . ")</li>";
  330. }
  331. echo "</ol>";
  332. ]]></programlisting>
  333. </example>
  334. </sect3>
  335. <sect3 id="zend.service.technorati.queries.toptags">
  336. <title>Technorati TopTags</title>
  337. <para>
  338. The <ulink url="http://technorati.com/developers/api/toptags.html">TopTags</ulink> query provides
  339. information on top tags indexed by Technorati. It returns a
  340. <link linkend="zend.service.technorati.classes.tagsresultset"><classname>Zend_Service_Technorati_TagsResultSet</classname></link>
  341. object. For full details please see <methodname>Zend_Service_Technorati::topTags()</methodname> in the
  342. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  343. </para>
  344. <example id="zend.service.technorati.queries.toptags.example-1">
  345. <title>TopTags Query</title>
  346. <programlisting language="php"><![CDATA[
  347. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  348. $resultSet = $technorati->topTags();
  349. echo "<p>Reading " . $resultSet->totalResults() .
  350. " of " . $resultSet->totalResultsAvailable() .
  351. " available results</p>";
  352. echo "<ol>";
  353. foreach ($resultSet as $result) {
  354. echo "<li>" . $result->getTag() . "</li>";
  355. }
  356. echo "</ol>";
  357. ]]></programlisting>
  358. </example>
  359. </sect3>
  360. <sect3 id="zend.service.technorati.queries.bloginfo">
  361. <title>Technorati BlogInfo</title>
  362. <para>
  363. The <ulink url="http://technorati.com/developers/api/bloginfo.html">BlogInfo</ulink> query provides
  364. information on what blog, if any, is associated with a given <acronym>URL</acronym>. It returns a
  365. <link linkend="zend.service.technorati.classes.bloginforesult"><classname>Zend_Service_Technorati_BlogInfoResult</classname></link>
  366. object. For full details please see <methodname>Zend_Service_Technorati::blogInfo()</methodname> in the
  367. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  368. </para>
  369. <example id="zend.service.technorati.queries.bloginfo.example-1">
  370. <title>BlogInfo Query</title>
  371. <programlisting language="php"><![CDATA[
  372. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  373. $result = $technorati->blogInfo('http://devzone.zend.com/');
  374. echo '<h2><a href="' . (string) $result->getWeblog()->getUrl() . '">' .
  375. $result->getWeblog()->getName() . '</a></h2>';
  376. ]]></programlisting>
  377. </example>
  378. </sect3>
  379. <sect3 id="zend.service.technorati.queries.blogposttags">
  380. <title>Technorati BlogPostTags</title>
  381. <para>
  382. The <ulink url="http://technorati.com/developers/api/blogposttags.html">BlogPostTags</ulink> query
  383. provides information on the top tags used by a specific blog. It returns a
  384. <link linkend="zend.service.technorati.classes.tagsresultset"><classname>Zend_Service_Technorati_TagsResultSet</classname></link>
  385. object. For full details please see <methodname>Zend_Service_Technorati::blogPostTags()</methodname> in the
  386. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  387. </para>
  388. <example id="zend.service.technorati.queries.blogposttags.example-1">
  389. <title>BlogPostTags Query</title>
  390. <programlisting language="php"><![CDATA[
  391. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  392. $resultSet = $technorati->blogPostTags('http://devzone.zend.com/');
  393. echo "<p>Reading " . $resultSet->totalResults() .
  394. " of " . $resultSet->totalResultsAvailable() .
  395. " available results</p>";
  396. echo "<ol>";
  397. foreach ($resultSet as $result) {
  398. echo "<li>" . $result->getTag() . "</li>";
  399. }
  400. echo "</ol>";
  401. ]]></programlisting>
  402. </example>
  403. </sect3>
  404. <sect3 id="zend.service.technorati.queries.getinfo">
  405. <title>Technorati GetInfo</title>
  406. <para>
  407. The <ulink url="http://technorati.com/developers/api/getinfo.html">GetInfo</ulink> query tells you
  408. things that Technorati knows about a member. It returns a
  409. <link linkend="zend.service.technorati.classes.getinforesult"><classname>Zend_Service_Technorati_GetInfoResult</classname></link>
  410. object. For full details please see <methodname>Zend_Service_Technorati::getInfo()</methodname> in the
  411. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  412. </para>
  413. <example id="zend.service.technorati.queries.getinfo.example-1">
  414. <title>GetInfo Query</title>
  415. <programlisting language="php"><![CDATA[
  416. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  417. $result = $technorati->getInfo('weppos');
  418. $author = $result->getAuthor();
  419. echo "<h2>Blogs authored by " . $author->getFirstName() . " " .
  420. $author->getLastName() . "</h2>";
  421. echo "<ol>";
  422. foreach ($result->getWeblogs() as $weblog) {
  423. echo "<li>" . $weblog->getName() . "</li>";
  424. }
  425. echo "</ol>";
  426. ]]></programlisting>
  427. </example>
  428. </sect3>
  429. <sect3 id="zend.service.technorati.queries.keyinfo">
  430. <title>Technorati KeyInfo</title>
  431. <para>
  432. The KeyInfo query provides information on daily usage of an <acronym>API</acronym> key. It returns a
  433. <link linkend="zend.service.technorati.classes.keyinforesult"><classname>Zend_Service_Technorati_KeyInfoResult</classname></link>
  434. object. For full details please see <methodname>Zend_Service_Technorati::keyInfo()</methodname> in the
  435. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  436. </para>
  437. </sect3>
  438. </sect2>
  439. <sect2 id="zend.service.technorati.classes">
  440. <title>Zend_Service_Technorati Classes</title>
  441. <para>
  442. The following classes are returned by the various Technorati queries. Each
  443. <classname>Zend_Service_Technorati_*ResultSet</classname> class holds a type-specific result set which can be easily
  444. iterated, with each result being contained in a type result object. All result set classes extend
  445. <classname>Zend_Service_Technorati_ResultSet</classname> class and implement the <code>SeekableIterator</code>
  446. interface, allowing for easy iteration and seeking to a specific result.
  447. <itemizedlist>
  448. <listitem><para><link linkend="zend.service.technorati.classes.resultset"><classname>Zend_Service_Technorati_ResultSet</classname></link></para></listitem>
  449. <listitem><para><link linkend="zend.service.technorati.classes.cosmosresultset"><classname>Zend_Service_Technorati_CosmosResultSet</classname></link></para></listitem>
  450. <listitem><para><link linkend="zend.service.technorati.classes.searchresultset"><classname>Zend_Service_Technorati_SearchResultSet</classname></link></para></listitem>
  451. <listitem><para><link linkend="zend.service.technorati.classes.tagresultset"><classname>Zend_Service_Technorati_TagResultSet</classname></link></para></listitem>
  452. <listitem><para><link linkend="zend.service.technorati.classes.dailycountsresultset"><classname>Zend_Service_Technorati_DailyCountsResultSet</classname></link></para></listitem>
  453. <listitem><para><link linkend="zend.service.technorati.classes.tagsresultset"><classname>Zend_Service_Technorati_TagsResultSet</classname></link></para></listitem>
  454. <listitem><para><link linkend="zend.service.technorati.classes.result"><classname>Zend_Service_Technorati_Result</classname></link></para></listitem>
  455. <listitem><para><link linkend="zend.service.technorati.classes.cosmosresult"><classname>Zend_Service_Technorati_CosmosResult</classname></link></para></listitem>
  456. <listitem><para><link linkend="zend.service.technorati.classes.searchresult"><classname>Zend_Service_Technorati_SearchResult</classname></link></para></listitem>
  457. <listitem><para><link linkend="zend.service.technorati.classes.tagresult"><classname>Zend_Service_Technorati_TagResult</classname></link></para></listitem>
  458. <listitem><para><link linkend="zend.service.technorati.classes.dailycountsresult"><classname>Zend_Service_Technorati_DailyCountsResult</classname></link></para></listitem>
  459. <listitem><para><link linkend="zend.service.technorati.classes.tagsresult"><classname>Zend_Service_Technorati_TagsResult</classname></link></para></listitem>
  460. <listitem><para><link linkend="zend.service.technorati.classes.getinforesult"><classname>Zend_Service_Technorati_GetInfoResult</classname></link></para></listitem>
  461. <listitem><para><link linkend="zend.service.technorati.classes.bloginforesult"><classname>Zend_Service_Technorati_BlogInfoResult</classname></link></para></listitem>
  462. <listitem><para><link linkend="zend.service.technorati.classes.keyinforesult"><classname>Zend_Service_Technorati_KeyInfoResult</classname></link></para></listitem>
  463. </itemizedlist>
  464. </para>
  465. <note>
  466. <para>
  467. <classname>Zend_Service_Technorati_GetInfoResult</classname>, <classname>Zend_Service_Technorati_BlogInfoResult</classname>
  468. and <classname>Zend_Service_Technorati_KeyInfoResult</classname> represent exceptions to the above because they
  469. don't belong to a result set and they don't implement any interface. They represent a single response
  470. object and they act as a wrapper for additional <classname>Zend_Service_Technorati</classname> objects, such as
  471. <classname>Zend_Service_Technorati_Author</classname> and <classname>Zend_Service_Technorati_Weblog</classname>.
  472. </para>
  473. </note>
  474. <para>
  475. The <classname>Zend_Service_Technorati</classname> library includes additional convenient classes representing
  476. specific response objects. <classname>Zend_Service_Technorati_Author</classname> represents a single Technorati
  477. account, also known as a blog author or blogger. <classname>Zend_Service_Technorati_Weblog</classname> represents a
  478. single weblog object, along with all specific weblog properties such as feed <acronym>URL</acronym>s or blog name. For full
  479. details please see <classname>Zend_Service_Technorati</classname> in the
  480. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  481. </para>
  482. <sect3 id="zend.service.technorati.classes.resultset">
  483. <title>Zend_Service_Technorati_ResultSet</title>
  484. <para>
  485. <classname>Zend_Service_Technorati_ResultSet</classname> is the most essential result set. The scope of this
  486. class is to be extended by a query-specific child result set class, and it should never be used to
  487. initialize a standalone object. Each of the specific result sets represents a collection of
  488. query-specific
  489. <link linkend="zend.service.technorati.classes.result"><classname>Zend_Service_Technorati_Result</classname></link>
  490. objects.
  491. </para>
  492. <para>
  493. <classname>Zend_Service_Technorati_ResultSet</classname> implements the <acronym>PHP</acronym> <code>SeekableIterator</code>
  494. interface, and you can iterate all result objects via the <acronym>PHP</acronym> <code>foreach</code> statement.
  495. </para>
  496. <example id="zend.service.technorati.classes.resultset.example-1">
  497. <title>Iterating result objects from a resultset collection</title>
  498. <programlisting language="php"><![CDATA[
  499. // run a simple query
  500. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  501. $resultSet = $technorati->search('php');
  502. // $resultSet is now an instance of
  503. // Zend_Service_Technorati_SearchResultSet
  504. // it extends Zend_Service_Technorati_ResultSet
  505. foreach ($resultSet as $result) {
  506. // do something with your
  507. // Zend_Service_Technorati_SearchResult object
  508. }
  509. ]]></programlisting>
  510. </example>
  511. </sect3>
  512. <sect3 id="zend.service.technorati.classes.cosmosresultset">
  513. <title>Zend_Service_Technorati_CosmosResultSet</title>
  514. <para>
  515. <classname>Zend_Service_Technorati_CosmosResultSet</classname> represents a Technorati Cosmos query result set.
  516. </para>
  517. <note>
  518. <para>
  519. <classname>Zend_Service_Technorati_CosmosResultSet</classname> extends
  520. <link linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  521. </para>
  522. </note>
  523. </sect3>
  524. <sect3 id="zend.service.technorati.classes.searchresultset">
  525. <title>Zend_Service_Technorati_SearchResultSet</title>
  526. <para>
  527. <classname>Zend_Service_Technorati_SearchResultSet</classname> represents a Technorati Search query result set.
  528. </para>
  529. <note>
  530. <para>
  531. <classname>Zend_Service_Technorati_SearchResultSet</classname> extends
  532. <link linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  533. </para>
  534. </note>
  535. </sect3>
  536. <sect3 id="zend.service.technorati.classes.tagresultset">
  537. <title>Zend_Service_Technorati_TagResultSet</title>
  538. <para>
  539. <classname>Zend_Service_Technorati_TagResultSet</classname> represents a Technorati Tag query result set.
  540. </para>
  541. <note>
  542. <para>
  543. <classname>Zend_Service_Technorati_TagResultSet</classname> extends
  544. <link linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  545. </para>
  546. </note>
  547. </sect3>
  548. <sect3 id="zend.service.technorati.classes.dailycountsresultset">
  549. <title>Zend_Service_Technorati_DailyCountsResultSet</title>
  550. <para>
  551. <classname>Zend_Service_Technorati_DailyCountsResultSet</classname> represents a Technorati DailyCounts query result set.
  552. </para>
  553. <note>
  554. <para>
  555. <classname>Zend_Service_Technorati_DailyCountsResultSet</classname> extends
  556. <link linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  557. </para>
  558. </note>
  559. </sect3>
  560. <sect3 id="zend.service.technorati.classes.tagsresultset">
  561. <title>Zend_Service_Technorati_TagsResultSet</title>
  562. <para>
  563. <classname>Zend_Service_Technorati_TagsResultSet</classname> represents a Technorati TopTags or BlogPostTags queries result set.
  564. </para>
  565. <note>
  566. <para>
  567. <classname>Zend_Service_Technorati_TagsResultSet</classname> extends
  568. <link linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  569. </para>
  570. </note>
  571. </sect3>
  572. <sect3 id="zend.service.technorati.classes.result">
  573. <title>Zend_Service_Technorati_Result</title>
  574. <para>
  575. <classname>Zend_Service_Technorati_Result</classname> is the most essential result object. The scope of this
  576. class is to be extended by a query specific child result class, and it should never be used to
  577. initialize a standalone object.
  578. </para>
  579. </sect3>
  580. <sect3 id="zend.service.technorati.classes.cosmosresult">
  581. <title>Zend_Service_Technorati_CosmosResult</title>
  582. <para>
  583. <classname>Zend_Service_Technorati_CosmosResult</classname> represents a single Technorati Cosmos query result
  584. object. It is never returned as a standalone object, but it always belongs to a valid
  585. <link linkend="zend.service.technorati.classes.cosmosresultset">Zend_Service_Technorati_CosmosResultSet</link>
  586. object.
  587. </para>
  588. <note>
  589. <para>
  590. <classname>Zend_Service_Technorati_CosmosResult</classname> extends
  591. <link linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  592. </para>
  593. </note>
  594. </sect3>
  595. <sect3 id="zend.service.technorati.classes.searchresult">
  596. <title>Zend_Service_Technorati_SearchResult</title>
  597. <para>
  598. <classname>Zend_Service_Technorati_SearchResult</classname> represents a single Technorati Search query result
  599. object. It is never returned as a standalone object, but it always belongs to a valid
  600. <link linkend="zend.service.technorati.classes.searchresultset">Zend_Service_Technorati_SearchResultSet</link>
  601. object.
  602. </para>
  603. <note>
  604. <para>
  605. <classname>Zend_Service_Technorati_SearchResult</classname> extends
  606. <link linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  607. </para>
  608. </note>
  609. </sect3>
  610. <sect3 id="zend.service.technorati.classes.tagresult">
  611. <title>Zend_Service_Technorati_TagResult</title>
  612. <para>
  613. <classname>Zend_Service_Technorati_TagResult</classname> represents a single Technorati Tag query result object.
  614. It is never returned as a standalone object, but it always belongs to a valid
  615. <link linkend="zend.service.technorati.classes.tagresultset">Zend_Service_Technorati_TagResultSet</link>
  616. object.
  617. </para>
  618. <note>
  619. <para>
  620. <classname>Zend_Service_Technorati_TagResult</classname> extends
  621. <link linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  622. </para>
  623. </note>
  624. </sect3>
  625. <sect3 id="zend.service.technorati.classes.dailycountsresult">
  626. <title>Zend_Service_Technorati_DailyCountsResult</title>
  627. <para>
  628. <classname>Zend_Service_Technorati_DailyCountsResult</classname> represents a single Technorati DailyCounts query
  629. result object. It is never returned as a standalone object, but it always belongs to a valid
  630. <link linkend="zend.service.technorati.classes.dailycountsresultset">Zend_Service_Technorati_DailyCountsResultSet</link>
  631. object.
  632. </para>
  633. <note>
  634. <para>
  635. <classname>Zend_Service_Technorati_DailyCountsResult</classname> extends
  636. <link linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  637. </para>
  638. </note>
  639. </sect3>
  640. <sect3 id="zend.service.technorati.classes.tagsresult">
  641. <title>Zend_Service_Technorati_TagsResult</title>
  642. <para>
  643. <classname>Zend_Service_Technorati_TagsResult</classname> represents a single Technorati TopTags or BlogPostTags
  644. query result object. It is never returned as a standalone object, but it always belongs to a valid
  645. <link linkend="zend.service.technorati.classes.tagsresultset">Zend_Service_Technorati_TagsResultSet </link>
  646. object.
  647. </para>
  648. <note>
  649. <para>
  650. <classname>Zend_Service_Technorati_TagsResult</classname> extends
  651. <link linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  652. </para>
  653. </note>
  654. </sect3>
  655. <sect3 id="zend.service.technorati.classes.getinforesult">
  656. <title>Zend_Service_Technorati_GetInfoResult</title>
  657. <para>
  658. <classname>Zend_Service_Technorati_GetInfoResult</classname> represents a single Technorati GetInfo query result
  659. object.
  660. </para>
  661. </sect3>
  662. <sect3 id="zend.service.technorati.classes.bloginforesult">
  663. <title>Zend_Service_Technorati_BlogInfoResult</title>
  664. <para>
  665. <classname>Zend_Service_Technorati_BlogInfoResult</classname> represents a single Technorati BlogInfo query
  666. result object.
  667. </para>
  668. </sect3>
  669. <sect3 id="zend.service.technorati.classes.keyinforesult">
  670. <title>Zend_Service_Technorati_KeyInfoResult</title>
  671. <para>
  672. <classname>Zend_Service_Technorati_KeyInfoResult</classname> represents a single Technorati KeyInfo query result
  673. object. It provides information about your
  674. <link linkend="zend.service.technorati.checking-api-daily-usage">Technorati <acronym>API</acronym> Key daily usage</link>.
  675. </para>
  676. </sect3>
  677. </sect2>
  678. </sect1>