Zend_Service_Technorati.xml 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019
  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. <code>SeekableIterator</code> <acronym>PHP</acronym> interface. The best way to consume
  110. a result set object is to loop over it with the <acronym>PHP</acronym>
  111. <code>foreach</code> 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. <code>SeekableIterator</code> interface, you can seek a specific result object using its
  131. 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. <code>SeekableIterator</code> works as an array and counts positions starting from
  150. index 0. Fetching position number 1 means getting the second result in the
  151. 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 <code>try</code>...<code>catch</code>
  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 queries:
  248. <itemizedlist>
  249. <listitem>
  250. <para>
  251. <link
  252. linkend="zend.service.technorati.queries.cosmos"><code>Cosmos</code></link>
  253. </para>
  254. </listitem>
  255. <listitem>
  256. <para>
  257. <link
  258. linkend="zend.service.technorati.queries.search"><code>Search</code></link>
  259. </para>
  260. </listitem>
  261. <listitem>
  262. <para>
  263. <link linkend="zend.service.technorati.queries.tag"><code>Tag</code></link>
  264. </para>
  265. </listitem>
  266. <listitem>
  267. <para>
  268. <link
  269. linkend="zend.service.technorati.queries.dailycounts"><code>DailyCounts</code></link>
  270. </para>
  271. </listitem>
  272. <listitem>
  273. <para>
  274. <link
  275. linkend="zend.service.technorati.queries.toptags"><code>TopTags</code></link>
  276. </para>
  277. </listitem>
  278. <listitem>
  279. <para>
  280. <link
  281. linkend="zend.service.technorati.queries.bloginfo"><code>BlogInfo</code></link>
  282. </para>
  283. </listitem>
  284. <listitem>
  285. <para>
  286. <link
  287. linkend="zend.service.technorati.queries.blogposttags"><code>BlogPostTags</code></link>
  288. </para>
  289. </listitem>
  290. <listitem>
  291. <para>
  292. <link
  293. linkend="zend.service.technorati.queries.getinfo"><code>GetInfo</code></link>
  294. </para>
  295. </listitem>
  296. </itemizedlist>
  297. </para>
  298. <sect3 id="zend.service.technorati.queries.cosmos">
  299. <title>Technorati Cosmos</title>
  300. <para>
  301. <ulink url="http://technorati.com/developers/api/cosmos.html">Cosmos</ulink> query
  302. lets you see what blogs are linking to a given <acronym>URL</acronym>. It returns a
  303. <link
  304. linkend="zend.service.technorati.classes.cosmosresultset"><classname>Zend_Service_Technorati_CosmosResultSet</classname></link>
  305. object. For full details please see
  306. <methodname>Zend_Service_Technorati::cosmos()</methodname> in the
  307. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  308. </para>
  309. <example id="zend.service.technorati.queries.cosmos.example-1">
  310. <title>Cosmos Query</title>
  311. <programlisting language="php"><![CDATA[
  312. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  313. $resultSet = $technorati->cosmos('http://devzone.zend.com/');
  314. echo "<p>Reading " . $resultSet->totalResults() .
  315. " of " . $resultSet->totalResultsAvailable() .
  316. " available results</p>";
  317. echo "<ol>";
  318. foreach ($resultSet as $result) {
  319. echo "<li>" . $result->getWeblog()->getName() . "</li>";
  320. }
  321. echo "</ol>";
  322. ]]></programlisting>
  323. </example>
  324. </sect3>
  325. <sect3 id="zend.service.technorati.queries.search">
  326. <title>Technorati Search</title>
  327. <para>
  328. The <ulink url="http://technorati.com/developers/api/search.html">Search</ulink>
  329. query lets you see what blogs contain a given search string. It returns a <link
  330. linkend="zend.service.technorati.classes.searchresultset"><classname>Zend_Service_Technorati_SearchResultSet</classname></link>
  331. object. For full details please see
  332. <methodname>Zend_Service_Technorati::search()</methodname> in the
  333. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  334. </para>
  335. <example id="zend.service.technorati.queries.search.example-1">
  336. <title>Search Query</title>
  337. <programlisting language="php"><![CDATA[
  338. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  339. $resultSet = $technorati->search('zend framework');
  340. echo "<p>Reading " . $resultSet->totalResults() .
  341. " of " . $resultSet->totalResultsAvailable() .
  342. " available results</p>";
  343. echo "<ol>";
  344. foreach ($resultSet as $result) {
  345. echo "<li>" . $result->getWeblog()->getName() . "</li>";
  346. }
  347. echo "</ol>";
  348. ]]></programlisting>
  349. </example>
  350. </sect3>
  351. <sect3 id="zend.service.technorati.queries.tag">
  352. <title>Technorati Tag</title>
  353. <para>
  354. The <ulink url="http://technorati.com/developers/api/tag.html">Tag</ulink> query
  355. lets you see what posts are associated with a given tag. It returns a <link
  356. linkend="zend.service.technorati.classes.tagresultset"><classname>Zend_Service_Technorati_TagResultSet</classname></link>
  357. object. For full details please see
  358. <methodname>Zend_Service_Technorati::tag()</methodname> in the
  359. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  360. </para>
  361. <example id="zend.service.technorati.queries.tag.example-1">
  362. <title>Tag Query</title>
  363. <programlisting language="php"><![CDATA[
  364. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  365. $resultSet = $technorati->tag('php');
  366. echo "<p>Reading " . $resultSet->totalResults() .
  367. " of " . $resultSet->totalResultsAvailable() .
  368. " available results</p>";
  369. echo "<ol>";
  370. foreach ($resultSet as $result) {
  371. echo "<li>" . $result->getWeblog()->getName() . "</li>";
  372. }
  373. echo "</ol>";
  374. ]]></programlisting>
  375. </example>
  376. </sect3>
  377. <sect3 id="zend.service.technorati.queries.dailycounts">
  378. <title>Technorati DailyCounts</title>
  379. <para>
  380. The <ulink
  381. url="http://technorati.com/developers/api/dailycounts.html">DailyCounts</ulink>
  382. query provides daily counts of posts containing the queried keyword. It returns a
  383. <link
  384. linkend="zend.service.technorati.classes.dailycountsresultset"><classname>Zend_Service_Technorati_DailyCountsResultSet</classname></link>
  385. object. For full details please see
  386. <methodname>Zend_Service_Technorati::dailyCounts()</methodname> in the
  387. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  388. </para>
  389. <example id="zend.service.technorati.queries.dailycounts.example-1">
  390. <title>DailyCounts Query</title>
  391. <programlisting language="php"><![CDATA[
  392. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  393. $resultSet = $technorati->dailyCounts('php');
  394. foreach ($resultSet as $result) {
  395. echo "<li>" . $result->getDate() .
  396. "(" . $result->getCount() . ")</li>";
  397. }
  398. echo "</ol>";
  399. ]]></programlisting>
  400. </example>
  401. </sect3>
  402. <sect3 id="zend.service.technorati.queries.toptags">
  403. <title>Technorati TopTags</title>
  404. <para>
  405. The <ulink url="http://technorati.com/developers/api/toptags.html">TopTags</ulink>
  406. query provides information on top tags indexed by Technorati. It returns a <link
  407. linkend="zend.service.technorati.classes.tagsresultset"><classname>Zend_Service_Technorati_TagsResultSet</classname></link>
  408. object. For full details please see
  409. <methodname>Zend_Service_Technorati::topTags()</methodname> in the
  410. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  411. </para>
  412. <example id="zend.service.technorati.queries.toptags.example-1">
  413. <title>TopTags Query</title>
  414. <programlisting language="php"><![CDATA[
  415. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  416. $resultSet = $technorati->topTags();
  417. echo "<p>Reading " . $resultSet->totalResults() .
  418. " of " . $resultSet->totalResultsAvailable() .
  419. " available results</p>";
  420. echo "<ol>";
  421. foreach ($resultSet as $result) {
  422. echo "<li>" . $result->getTag() . "</li>";
  423. }
  424. echo "</ol>";
  425. ]]></programlisting>
  426. </example>
  427. </sect3>
  428. <sect3 id="zend.service.technorati.queries.bloginfo">
  429. <title>Technorati BlogInfo</title>
  430. <para>
  431. The <ulink url="http://technorati.com/developers/api/bloginfo.html">BlogInfo</ulink>
  432. query provides information on what blog, if any, is associated with a given
  433. <acronym>URL</acronym>. It returns a <link
  434. linkend="zend.service.technorati.classes.bloginforesult"><classname>Zend_Service_Technorati_BlogInfoResult</classname></link>
  435. object. For full details please see
  436. <methodname>Zend_Service_Technorati::blogInfo()</methodname> in the
  437. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  438. </para>
  439. <example id="zend.service.technorati.queries.bloginfo.example-1">
  440. <title>BlogInfo Query</title>
  441. <programlisting language="php"><![CDATA[
  442. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  443. $result = $technorati->blogInfo('http://devzone.zend.com/');
  444. echo '<h2><a href="' . (string) $result->getWeblog()->getUrl() . '">' .
  445. $result->getWeblog()->getName() . '</a></h2>';
  446. ]]></programlisting>
  447. </example>
  448. </sect3>
  449. <sect3 id="zend.service.technorati.queries.blogposttags">
  450. <title>Technorati BlogPostTags</title>
  451. <para>
  452. The <ulink
  453. url="http://technorati.com/developers/api/blogposttags.html">BlogPostTags</ulink>
  454. query provides information on the top tags used by a specific blog. It returns a
  455. <link
  456. linkend="zend.service.technorati.classes.tagsresultset"><classname>Zend_Service_Technorati_TagsResultSet</classname></link>
  457. object. For full details please see
  458. <methodname>Zend_Service_Technorati::blogPostTags()</methodname> in the
  459. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  460. </para>
  461. <example id="zend.service.technorati.queries.blogposttags.example-1">
  462. <title>BlogPostTags Query</title>
  463. <programlisting language="php"><![CDATA[
  464. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  465. $resultSet = $technorati->blogPostTags('http://devzone.zend.com/');
  466. echo "<p>Reading " . $resultSet->totalResults() .
  467. " of " . $resultSet->totalResultsAvailable() .
  468. " available results</p>";
  469. echo "<ol>";
  470. foreach ($resultSet as $result) {
  471. echo "<li>" . $result->getTag() . "</li>";
  472. }
  473. echo "</ol>";
  474. ]]></programlisting>
  475. </example>
  476. </sect3>
  477. <sect3 id="zend.service.technorati.queries.getinfo">
  478. <title>Technorati GetInfo</title>
  479. <para>
  480. The <ulink url="http://technorati.com/developers/api/getinfo.html">GetInfo</ulink>
  481. query tells you things that Technorati knows about a member. It returns a <link
  482. linkend="zend.service.technorati.classes.getinforesult"><classname>Zend_Service_Technorati_GetInfoResult</classname></link>
  483. object. For full details please see
  484. <methodname>Zend_Service_Technorati::getInfo()</methodname> in the
  485. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  486. </para>
  487. <example id="zend.service.technorati.queries.getinfo.example-1">
  488. <title>GetInfo Query</title>
  489. <programlisting language="php"><![CDATA[
  490. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  491. $result = $technorati->getInfo('weppos');
  492. $author = $result->getAuthor();
  493. echo "<h2>Blogs authored by " . $author->getFirstName() . " " .
  494. $author->getLastName() . "</h2>";
  495. echo "<ol>";
  496. foreach ($result->getWeblogs() as $weblog) {
  497. echo "<li>" . $weblog->getName() . "</li>";
  498. }
  499. echo "</ol>";
  500. ]]></programlisting>
  501. </example>
  502. </sect3>
  503. <sect3 id="zend.service.technorati.queries.keyinfo">
  504. <title>Technorati KeyInfo</title>
  505. <para>
  506. The KeyInfo query provides information on daily usage of an <acronym>API</acronym>
  507. key. It returns a <link
  508. linkend="zend.service.technorati.classes.keyinforesult"><classname>Zend_Service_Technorati_KeyInfoResult</classname></link>
  509. object. For full details please see
  510. <methodname>Zend_Service_Technorati::keyInfo()</methodname> in the
  511. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  512. </para>
  513. </sect3>
  514. </sect2>
  515. <sect2 id="zend.service.technorati.classes">
  516. <title>Zend_Service_Technorati Classes</title>
  517. <para>
  518. The following classes are returned by the various Technorati queries. Each
  519. <classname>Zend_Service_Technorati_*ResultSet</classname> class holds a type-specific
  520. result set which can be easily iterated, with each result being contained in a type
  521. result object. All result set classes extend
  522. <classname>Zend_Service_Technorati_ResultSet</classname> class and implement the
  523. <code>SeekableIterator</code> interface, allowing for easy iteration and seeking to a
  524. specific result.
  525. <itemizedlist>
  526. <listitem>
  527. <para>
  528. <link
  529. linkend="zend.service.technorati.classes.resultset"><classname>Zend_Service_Technorati_ResultSet</classname></link>
  530. </para>
  531. </listitem>
  532. <listitem>
  533. <para>
  534. <link
  535. linkend="zend.service.technorati.classes.cosmosresultset"><classname>Zend_Service_Technorati_CosmosResultSet</classname></link>
  536. </para>
  537. </listitem>
  538. <listitem>
  539. <para>
  540. <link
  541. linkend="zend.service.technorati.classes.searchresultset"><classname>Zend_Service_Technorati_SearchResultSet</classname></link>
  542. </para>
  543. </listitem>
  544. <listitem>
  545. <para>
  546. <link
  547. linkend="zend.service.technorati.classes.tagresultset"><classname>Zend_Service_Technorati_TagResultSet</classname></link>
  548. </para>
  549. </listitem>
  550. <listitem>
  551. <para>
  552. <link
  553. linkend="zend.service.technorati.classes.dailycountsresultset"><classname>Zend_Service_Technorati_DailyCountsResultSet</classname></link>
  554. </para>
  555. </listitem>
  556. <listitem>
  557. <para>
  558. <link
  559. linkend="zend.service.technorati.classes.tagsresultset"><classname>Zend_Service_Technorati_TagsResultSet</classname></link>
  560. </para>
  561. </listitem>
  562. <listitem>
  563. <para>
  564. <link
  565. linkend="zend.service.technorati.classes.result"><classname>Zend_Service_Technorati_Result</classname></link>
  566. </para>
  567. </listitem>
  568. <listitem>
  569. <para>
  570. <link
  571. linkend="zend.service.technorati.classes.cosmosresult"><classname>Zend_Service_Technorati_CosmosResult</classname></link>
  572. </para>
  573. </listitem>
  574. <listitem>
  575. <para>
  576. <link
  577. linkend="zend.service.technorati.classes.searchresult"><classname>Zend_Service_Technorati_SearchResult</classname></link>
  578. </para>
  579. </listitem>
  580. <listitem>
  581. <para>
  582. <link
  583. linkend="zend.service.technorati.classes.tagresult"><classname>Zend_Service_Technorati_TagResult</classname></link>
  584. </para>
  585. </listitem>
  586. <listitem>
  587. <para>
  588. <link
  589. linkend="zend.service.technorati.classes.dailycountsresult"><classname>Zend_Service_Technorati_DailyCountsResult</classname></link>
  590. </para>
  591. </listitem>
  592. <listitem>
  593. <para>
  594. <link
  595. linkend="zend.service.technorati.classes.tagsresult"><classname>Zend_Service_Technorati_TagsResult</classname></link>
  596. </para>
  597. </listitem>
  598. <listitem>
  599. <para>
  600. <link
  601. linkend="zend.service.technorati.classes.getinforesult"><classname>Zend_Service_Technorati_GetInfoResult</classname></link>
  602. </para>
  603. </listitem>
  604. <listitem>
  605. <para>
  606. <link
  607. linkend="zend.service.technorati.classes.bloginforesult"><classname>Zend_Service_Technorati_BlogInfoResult</classname></link>
  608. </para>
  609. </listitem>
  610. <listitem>
  611. <para>
  612. <link
  613. linkend="zend.service.technorati.classes.keyinforesult"><classname>Zend_Service_Technorati_KeyInfoResult</classname></link>
  614. </para>
  615. </listitem>
  616. </itemizedlist>
  617. </para>
  618. <note>
  619. <para>
  620. <classname>Zend_Service_Technorati_GetInfoResult</classname>,
  621. <classname>Zend_Service_Technorati_BlogInfoResult</classname> and
  622. <classname>Zend_Service_Technorati_KeyInfoResult</classname> represent exceptions to
  623. the above because they don't belong to a result set and they don't implement any
  624. interface. They represent a single response object and they act as a wrapper for
  625. additional <classname>Zend_Service_Technorati</classname> objects, such as
  626. <classname>Zend_Service_Technorati_Author</classname> and
  627. <classname>Zend_Service_Technorati_Weblog</classname>.
  628. </para>
  629. </note>
  630. <para>
  631. The <classname>Zend_Service_Technorati</classname> library includes additional
  632. convenient classes representing specific response objects.
  633. <classname>Zend_Service_Technorati_Author</classname> represents a single Technorati
  634. account, also known as a blog author or blogger.
  635. <classname>Zend_Service_Technorati_Weblog</classname> represents a single weblog object,
  636. along with all specific weblog properties such as feed <acronym>URL</acronym>s or blog
  637. name. For full details please see <classname>Zend_Service_Technorati</classname> in the
  638. <ulink url="http://framework.zend.com/apidoc/core/">API reference guide</ulink>.
  639. </para>
  640. <sect3 id="zend.service.technorati.classes.resultset">
  641. <title>Zend_Service_Technorati_ResultSet</title>
  642. <para>
  643. <classname>Zend_Service_Technorati_ResultSet</classname> is the most essential
  644. result set. The scope of this class is to be extended by a query-specific child
  645. result set class, and it should never be used to initialize a standalone object.
  646. Each of the specific result sets represents a collection of query-specific <link
  647. linkend="zend.service.technorati.classes.result"><classname>Zend_Service_Technorati_Result</classname></link>
  648. objects.
  649. </para>
  650. <para>
  651. <classname>Zend_Service_Technorati_ResultSet</classname> implements the
  652. <acronym>PHP</acronym> <code>SeekableIterator</code> interface, and you can iterate
  653. all result objects via the <acronym>PHP</acronym> <code>foreach</code> statement.
  654. </para>
  655. <example id="zend.service.technorati.classes.resultset.example-1">
  656. <title>Iterating result objects from a resultset collection</title>
  657. <programlisting language="php"><![CDATA[
  658. // run a simple query
  659. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  660. $resultSet = $technorati->search('php');
  661. // $resultSet is now an instance of
  662. // Zend_Service_Technorati_SearchResultSet
  663. // it extends Zend_Service_Technorati_ResultSet
  664. foreach ($resultSet as $result) {
  665. // do something with your
  666. // Zend_Service_Technorati_SearchResult object
  667. }
  668. ]]></programlisting>
  669. </example>
  670. </sect3>
  671. <sect3 id="zend.service.technorati.classes.cosmosresultset">
  672. <title>Zend_Service_Technorati_CosmosResultSet</title>
  673. <para>
  674. <classname>Zend_Service_Technorati_CosmosResultSet</classname> represents a
  675. Technorati Cosmos query result set.
  676. </para>
  677. <note>
  678. <para>
  679. <classname>Zend_Service_Technorati_CosmosResultSet</classname> extends <link
  680. linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  681. </para>
  682. </note>
  683. </sect3>
  684. <sect3 id="zend.service.technorati.classes.searchresultset">
  685. <title>Zend_Service_Technorati_SearchResultSet</title>
  686. <para>
  687. <classname>Zend_Service_Technorati_SearchResultSet</classname> represents a
  688. Technorati Search query result set.
  689. </para>
  690. <note>
  691. <para>
  692. <classname>Zend_Service_Technorati_SearchResultSet</classname> extends <link
  693. linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  694. </para>
  695. </note>
  696. </sect3>
  697. <sect3 id="zend.service.technorati.classes.tagresultset">
  698. <title>Zend_Service_Technorati_TagResultSet</title>
  699. <para>
  700. <classname>Zend_Service_Technorati_TagResultSet</classname> represents a Technorati
  701. Tag query result set.
  702. </para>
  703. <note>
  704. <para>
  705. <classname>Zend_Service_Technorati_TagResultSet</classname> extends <link
  706. linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  707. </para>
  708. </note>
  709. </sect3>
  710. <sect3 id="zend.service.technorati.classes.dailycountsresultset">
  711. <title>Zend_Service_Technorati_DailyCountsResultSet</title>
  712. <para>
  713. <classname>Zend_Service_Technorati_DailyCountsResultSet</classname> represents a
  714. Technorati DailyCounts query result set.
  715. </para>
  716. <note>
  717. <para>
  718. <classname>Zend_Service_Technorati_DailyCountsResultSet</classname> extends
  719. <link
  720. linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  721. </para>
  722. </note>
  723. </sect3>
  724. <sect3 id="zend.service.technorati.classes.tagsresultset">
  725. <title>Zend_Service_Technorati_TagsResultSet</title>
  726. <para>
  727. <classname>Zend_Service_Technorati_TagsResultSet</classname> represents a Technorati
  728. TopTags or BlogPostTags queries result set.
  729. </para>
  730. <note>
  731. <para>
  732. <classname>Zend_Service_Technorati_TagsResultSet</classname> extends
  733. <link
  734. linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  735. </para>
  736. </note>
  737. </sect3>
  738. <sect3 id="zend.service.technorati.classes.result">
  739. <title>Zend_Service_Technorati_Result</title>
  740. <para>
  741. <classname>Zend_Service_Technorati_Result</classname> is the most essential result
  742. object. The scope of this class is to be extended by a query specific child result
  743. class, and it should never be used to initialize a standalone object.
  744. </para>
  745. </sect3>
  746. <sect3 id="zend.service.technorati.classes.cosmosresult">
  747. <title>Zend_Service_Technorati_CosmosResult</title>
  748. <para>
  749. <classname>Zend_Service_Technorati_CosmosResult</classname> represents a single
  750. Technorati Cosmos query result object. It is never returned as a standalone object,
  751. but it always belongs to a valid <link
  752. linkend="zend.service.technorati.classes.cosmosresultset">Zend_Service_Technorati_CosmosResultSet</link>
  753. object.
  754. </para>
  755. <note>
  756. <para>
  757. <classname>Zend_Service_Technorati_CosmosResult</classname> extends <link
  758. linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  759. </para>
  760. </note>
  761. </sect3>
  762. <sect3 id="zend.service.technorati.classes.searchresult">
  763. <title>Zend_Service_Technorati_SearchResult</title>
  764. <para>
  765. <classname>Zend_Service_Technorati_SearchResult</classname> represents a single
  766. Technorati Search query result object. It is never returned as a standalone object,
  767. but it always belongs to a valid <link
  768. linkend="zend.service.technorati.classes.searchresultset">Zend_Service_Technorati_SearchResultSet</link>
  769. object.
  770. </para>
  771. <note>
  772. <para>
  773. <classname>Zend_Service_Technorati_SearchResult</classname> extends <link
  774. linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  775. </para>
  776. </note>
  777. </sect3>
  778. <sect3 id="zend.service.technorati.classes.tagresult">
  779. <title>Zend_Service_Technorati_TagResult</title>
  780. <para>
  781. <classname>Zend_Service_Technorati_TagResult</classname> represents a single
  782. Technorati Tag query result object. It is never returned as a standalone object, but
  783. it always belongs to a valid <link
  784. linkend="zend.service.technorati.classes.tagresultset">Zend_Service_Technorati_TagResultSet</link>
  785. object.
  786. </para>
  787. <note>
  788. <para>
  789. <classname>Zend_Service_Technorati_TagResult</classname> extends <link
  790. linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  791. </para>
  792. </note>
  793. </sect3>
  794. <sect3 id="zend.service.technorati.classes.dailycountsresult">
  795. <title>Zend_Service_Technorati_DailyCountsResult</title>
  796. <para>
  797. <classname>Zend_Service_Technorati_DailyCountsResult</classname> represents a single
  798. Technorati DailyCounts query result object. It is never returned as a standalone
  799. object, but it always belongs to a valid <link
  800. linkend="zend.service.technorati.classes.dailycountsresultset">Zend_Service_Technorati_DailyCountsResultSet</link>
  801. object.
  802. </para>
  803. <note>
  804. <para>
  805. <classname>Zend_Service_Technorati_DailyCountsResult</classname> extends <link
  806. linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  807. </para>
  808. </note>
  809. </sect3>
  810. <sect3 id="zend.service.technorati.classes.tagsresult">
  811. <title>Zend_Service_Technorati_TagsResult</title>
  812. <para>
  813. <classname>Zend_Service_Technorati_TagsResult</classname> represents a single
  814. Technorati TopTags or BlogPostTags query result object. It is never returned as a
  815. standalone object, but it always belongs to a valid <link
  816. linkend="zend.service.technorati.classes.tagsresultset">Zend_Service_Technorati_TagsResultSet </link>
  817. object.
  818. </para>
  819. <note>
  820. <para>
  821. <classname>Zend_Service_Technorati_TagsResult</classname> extends <link
  822. linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  823. </para>
  824. </note>
  825. </sect3>
  826. <sect3 id="zend.service.technorati.classes.getinforesult">
  827. <title>Zend_Service_Technorati_GetInfoResult</title>
  828. <para>
  829. <classname>Zend_Service_Technorati_GetInfoResult</classname> represents a single
  830. Technorati GetInfo query result object.
  831. </para>
  832. </sect3>
  833. <sect3 id="zend.service.technorati.classes.bloginforesult">
  834. <title>Zend_Service_Technorati_BlogInfoResult</title>
  835. <para>
  836. <classname>Zend_Service_Technorati_BlogInfoResult</classname> represents a single
  837. Technorati BlogInfo query result object.
  838. </para>
  839. </sect3>
  840. <sect3 id="zend.service.technorati.classes.keyinforesult">
  841. <title>Zend_Service_Technorati_KeyInfoResult</title>
  842. <para>
  843. <classname>Zend_Service_Technorati_KeyInfoResult</classname> represents a single
  844. Technorati KeyInfo query result object. It provides information about your
  845. <link linkend="zend.service.technorati.checking-api-daily-usage">Technorati
  846. <acronym>API</acronym> Key daily usage</link>.
  847. </para>
  848. </sect3>
  849. </sect2>
  850. </sect1>