Zend_Service_Technorati.xml 42 KB

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