Zend_Service_Technorati.xml 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020
  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
  248. queries:
  249. <itemizedlist>
  250. <listitem>
  251. <para>
  252. <link
  253. linkend="zend.service.technorati.queries.cosmos"><code>Cosmos</code></link>
  254. </para>
  255. </listitem>
  256. <listitem>
  257. <para>
  258. <link
  259. linkend="zend.service.technorati.queries.search"><code>Search</code></link>
  260. </para>
  261. </listitem>
  262. <listitem>
  263. <para>
  264. <link linkend="zend.service.technorati.queries.tag"><code>Tag</code></link>
  265. </para>
  266. </listitem>
  267. <listitem>
  268. <para>
  269. <link
  270. linkend="zend.service.technorati.queries.dailycounts"><code>DailyCounts</code></link>
  271. </para>
  272. </listitem>
  273. <listitem>
  274. <para>
  275. <link
  276. linkend="zend.service.technorati.queries.toptags"><code>TopTags</code></link>
  277. </para>
  278. </listitem>
  279. <listitem>
  280. <para>
  281. <link
  282. linkend="zend.service.technorati.queries.bloginfo"><code>BlogInfo</code></link>
  283. </para>
  284. </listitem>
  285. <listitem>
  286. <para>
  287. <link
  288. linkend="zend.service.technorati.queries.blogposttags"><code>BlogPostTags</code></link>
  289. </para>
  290. </listitem>
  291. <listitem>
  292. <para>
  293. <link
  294. linkend="zend.service.technorati.queries.getinfo"><code>GetInfo</code></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. <code>SeekableIterator</code> interface, allowing for easy iteration and seeking to a
  525. 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> <code>SeekableIterator</code> interface, and you can iterate
  654. all result objects via the <acronym>PHP</acronym> <code>foreach</code> statement.
  655. </para>
  656. <example id="zend.service.technorati.classes.resultset.example-1">
  657. <title>Iterating result objects from a resultset collection</title>
  658. <programlisting language="php"><![CDATA[
  659. // run a simple query
  660. $technorati = new Zend_Service_Technorati('VALID_API_KEY');
  661. $resultSet = $technorati->search('php');
  662. // $resultSet is now an instance of
  663. // Zend_Service_Technorati_SearchResultSet
  664. // it extends Zend_Service_Technorati_ResultSet
  665. foreach ($resultSet as $result) {
  666. // do something with your
  667. // Zend_Service_Technorati_SearchResult object
  668. }
  669. ]]></programlisting>
  670. </example>
  671. </sect3>
  672. <sect3 id="zend.service.technorati.classes.cosmosresultset">
  673. <title>Zend_Service_Technorati_CosmosResultSet</title>
  674. <para>
  675. <classname>Zend_Service_Technorati_CosmosResultSet</classname> represents a
  676. Technorati Cosmos query result set.
  677. </para>
  678. <note>
  679. <para>
  680. <classname>Zend_Service_Technorati_CosmosResultSet</classname> extends <link
  681. linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  682. </para>
  683. </note>
  684. </sect3>
  685. <sect3 id="zend.service.technorati.classes.searchresultset">
  686. <title>Zend_Service_Technorati_SearchResultSet</title>
  687. <para>
  688. <classname>Zend_Service_Technorati_SearchResultSet</classname> represents a
  689. Technorati Search query result set.
  690. </para>
  691. <note>
  692. <para>
  693. <classname>Zend_Service_Technorati_SearchResultSet</classname> extends <link
  694. linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  695. </para>
  696. </note>
  697. </sect3>
  698. <sect3 id="zend.service.technorati.classes.tagresultset">
  699. <title>Zend_Service_Technorati_TagResultSet</title>
  700. <para>
  701. <classname>Zend_Service_Technorati_TagResultSet</classname> represents a Technorati
  702. Tag query result set.
  703. </para>
  704. <note>
  705. <para>
  706. <classname>Zend_Service_Technorati_TagResultSet</classname> extends <link
  707. linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  708. </para>
  709. </note>
  710. </sect3>
  711. <sect3 id="zend.service.technorati.classes.dailycountsresultset">
  712. <title>Zend_Service_Technorati_DailyCountsResultSet</title>
  713. <para>
  714. <classname>Zend_Service_Technorati_DailyCountsResultSet</classname> represents a
  715. Technorati DailyCounts query result set.
  716. </para>
  717. <note>
  718. <para>
  719. <classname>Zend_Service_Technorati_DailyCountsResultSet</classname> extends
  720. <link
  721. linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  722. </para>
  723. </note>
  724. </sect3>
  725. <sect3 id="zend.service.technorati.classes.tagsresultset">
  726. <title>Zend_Service_Technorati_TagsResultSet</title>
  727. <para>
  728. <classname>Zend_Service_Technorati_TagsResultSet</classname> represents a Technorati
  729. TopTags or BlogPostTags queries result set.
  730. </para>
  731. <note>
  732. <para>
  733. <classname>Zend_Service_Technorati_TagsResultSet</classname> extends
  734. <link
  735. linkend="zend.service.technorati.classes.resultset">Zend_Service_Technorati_ResultSet</link>.
  736. </para>
  737. </note>
  738. </sect3>
  739. <sect3 id="zend.service.technorati.classes.result">
  740. <title>Zend_Service_Technorati_Result</title>
  741. <para>
  742. <classname>Zend_Service_Technorati_Result</classname> is the most essential result
  743. object. The scope of this class is to be extended by a query specific child result
  744. class, and it should never be used to initialize a standalone object.
  745. </para>
  746. </sect3>
  747. <sect3 id="zend.service.technorati.classes.cosmosresult">
  748. <title>Zend_Service_Technorati_CosmosResult</title>
  749. <para>
  750. <classname>Zend_Service_Technorati_CosmosResult</classname> represents a single
  751. Technorati Cosmos query result object. It is never returned as a standalone object,
  752. but it always belongs to a valid <link
  753. linkend="zend.service.technorati.classes.cosmosresultset">Zend_Service_Technorati_CosmosResultSet</link>
  754. object.
  755. </para>
  756. <note>
  757. <para>
  758. <classname>Zend_Service_Technorati_CosmosResult</classname> extends <link
  759. linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  760. </para>
  761. </note>
  762. </sect3>
  763. <sect3 id="zend.service.technorati.classes.searchresult">
  764. <title>Zend_Service_Technorati_SearchResult</title>
  765. <para>
  766. <classname>Zend_Service_Technorati_SearchResult</classname> represents a single
  767. Technorati Search query result object. It is never returned as a standalone object,
  768. but it always belongs to a valid <link
  769. linkend="zend.service.technorati.classes.searchresultset">Zend_Service_Technorati_SearchResultSet</link>
  770. object.
  771. </para>
  772. <note>
  773. <para>
  774. <classname>Zend_Service_Technorati_SearchResult</classname> extends <link
  775. linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  776. </para>
  777. </note>
  778. </sect3>
  779. <sect3 id="zend.service.technorati.classes.tagresult">
  780. <title>Zend_Service_Technorati_TagResult</title>
  781. <para>
  782. <classname>Zend_Service_Technorati_TagResult</classname> represents a single
  783. Technorati Tag query result object. It is never returned as a standalone object, but
  784. it always belongs to a valid <link
  785. linkend="zend.service.technorati.classes.tagresultset">Zend_Service_Technorati_TagResultSet</link>
  786. object.
  787. </para>
  788. <note>
  789. <para>
  790. <classname>Zend_Service_Technorati_TagResult</classname> extends <link
  791. linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  792. </para>
  793. </note>
  794. </sect3>
  795. <sect3 id="zend.service.technorati.classes.dailycountsresult">
  796. <title>Zend_Service_Technorati_DailyCountsResult</title>
  797. <para>
  798. <classname>Zend_Service_Technorati_DailyCountsResult</classname> represents a single
  799. Technorati DailyCounts query result object. It is never returned as a standalone
  800. object, but it always belongs to a valid <link
  801. linkend="zend.service.technorati.classes.dailycountsresultset">Zend_Service_Technorati_DailyCountsResultSet</link>
  802. object.
  803. </para>
  804. <note>
  805. <para>
  806. <classname>Zend_Service_Technorati_DailyCountsResult</classname> extends <link
  807. linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  808. </para>
  809. </note>
  810. </sect3>
  811. <sect3 id="zend.service.technorati.classes.tagsresult">
  812. <title>Zend_Service_Technorati_TagsResult</title>
  813. <para>
  814. <classname>Zend_Service_Technorati_TagsResult</classname> represents a single
  815. Technorati TopTags or BlogPostTags query result object. It is never returned as a
  816. standalone object, but it always belongs to a valid <link
  817. linkend="zend.service.technorati.classes.tagsresultset">Zend_Service_Technorati_TagsResultSet</link>
  818. object.
  819. </para>
  820. <note>
  821. <para>
  822. <classname>Zend_Service_Technorati_TagsResult</classname> extends <link
  823. linkend="zend.service.technorati.classes.result">Zend_Service_Technorati_Result</link>.
  824. </para>
  825. </note>
  826. </sect3>
  827. <sect3 id="zend.service.technorati.classes.getinforesult">
  828. <title>Zend_Service_Technorati_GetInfoResult</title>
  829. <para>
  830. <classname>Zend_Service_Technorati_GetInfoResult</classname> represents a single
  831. Technorati GetInfo query result object.
  832. </para>
  833. </sect3>
  834. <sect3 id="zend.service.technorati.classes.bloginforesult">
  835. <title>Zend_Service_Technorati_BlogInfoResult</title>
  836. <para>
  837. <classname>Zend_Service_Technorati_BlogInfoResult</classname> represents a single
  838. Technorati BlogInfo query result object.
  839. </para>
  840. </sect3>
  841. <sect3 id="zend.service.technorati.classes.keyinforesult">
  842. <title>Zend_Service_Technorati_KeyInfoResult</title>
  843. <para>
  844. <classname>Zend_Service_Technorati_KeyInfoResult</classname> represents a single
  845. Technorati KeyInfo query result object. It provides information about your
  846. <link linkend="zend.service.technorati.checking-api-daily-usage">Technorati
  847. <acronym>API</acronym> Key daily usage</link>.
  848. </para>
  849. </sect3>
  850. </sect2>
  851. </sect1>