cvs: peardoc /en/package/webservices/services-technorati intro.xml

From: Date: Fri, 09 Sep 2005 18:42:55 +0000
Subject: cvs: peardoc /en/package/webservices/services-technorati intro.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-6765@lists.php.net to get a copy of this message
jystewart Fri Sep 9 14:42:55 2005 EDT Added files: /peardoc/en/package/webservices/services-technorati intro.xml Log: First upload of documentation for services_technorati http://cvs.php.net/co.php/peardoc/en/package/webservices/services-technorati/intro.xml?r=1.1&p=1 Index: peardoc/en/package/webservices/services-technorati/intro.xml +++ peardoc/en/package/webservices/services-technorati/intro.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.webservices.services_technorati.intro"> <refnamediv> <refname>Introduction and Quick Start</refname> <refpurpose>Overview of Services_Technorati</refpurpose> </refnamediv> <refsect1 id="package.webservices.services_technorati.intro.desc"> &title.desc; <para>Technorati is a blog search engine. By indexing blogs and exploring links between them, they provide tools for monitoring online conversations taking place on and between blogs. By far the richest source of this information is through their REST-based API, to which this module provides an OO PHP interface. Full documentation for Technorati's API is available on their <ulink url="http://developers.technorati.com/wiki/TechnoratiApi">developers' wiki</ulink>. To use the API you will need an <ulink url="http://technorati.com/developers/apikey.html">API key</ulink>. </para> <para> To protect against future changes to the underlying API it is accessed using a factory method: <programlisting role="php">$tapi =& Services_Technorati::factory($api_key);</programlisting> </para> <para>The Technorati API limits you to 500 queries per day so those wishing to use it in a high-demand environment will want to employ some caching. Services_Technorati provides support for any caching system with a Cache_Lite-like API. To use a cache, you will need to create it and then pass it to the class in the factory: <programlisting role="php">$tapi =& Services_Technorati::factory($api_key, $cache_object);</programlisting> </para> <para> Once you have instantiated the object you can start passing in queries. Each call takes the form of methodName(keyParameter, options) where options is an array. <table> <title>Query types and their options</title> <tgroup cols="3"> <thead> <row> <entry>Query Name</entry> <entry>Key Parameter</entry> <entry>Permitted Options</entry> </row> </thead> <tbody> <row> <entry>cosmos</entry> <entry>url</entry> <entry>type, limit, start, current, claim, highlight</entry> </row> <row> <entry>search</entry> <entry>query keywords</entry> <entry>start, limit, claim</entry> </row> <row> <entry>outbound</entry> <entry>url</entry> <entry>start</entry> </row> <row> <entry>tag</entry> <entry>tag</entry> <entry>limit, start, format, excerptsize, topexcerptsize</entry> </row> <row> <entry>topTags</entry> <entry>-</entry> <entry>limit, start</entry> </row> <row> <entry>blogPostTags</entry> <entry>url</entry> <entry>limit</entry> </row> <row> <entry>getInfo</entry> <entry>username</entry> <entry>-</entry> </row> <row> <entry>blogInfo</entry> <entry>url</entry> <entry>-</entry> </row> </tbody> </tgroup> </table> (NB. Support for Technorati's attention.XML services is also included in accordance with the spec, but those services are currently in a state of flux so cannot be relied upon.) </para> <para> The value returned from each query will be either an array representing the unserialized XML or a PEAR Error. </para> <example> <title> An example return from the blogInfo query (for 'jystewart') is: </title> <programlisting role="php"> <![CDATA[ Array ( [version] => 1.0 [document] => Array ( [result] => Array ( [username] => jystewart [firstname] => James [lastname] => Stewart ) [item] => Array ( [0] => Array ( [weblog] => Array ( [name] => little more than a placeholder [url] => http://james.anthropiccollective.org [rssurl] => http://james.anthropiccollective.org/index.rdf [atomurl] => http://james.anthropiccollective.org/atom.xml [inboundblogs] => 52 [inboundlinks] => 82 [lastupdate] => 2005-08-27 09:01:42 GMT [rank] => 7483 [lat] => 0 [lon] => 0 [lang] => 26110 [foafurl] => http://jystewart.net/foaf.rdf ) ) [1] => Array ( [weblog] => Array ( [name] => something approaching a photo album [url] => http://approach.anthropiccollective.org [rssurl] => [atomurl] => [inboundblogs] => 1 [inboundlinks] => 1 [lastupdate] => 2004-08-13 17:40:02 GMT [rank] => 240760 [lat] => 0 [lon] => 0 [lang] => 0 ) ) [2] => Array ( [weblog] => Array ( [name] => grwifi.net : wireless internet (wifi) in grand rapids, michigan [url] => http://grwifi.net [rssurl] => [atomurl] => http://grwifi.net/atom/ [inboundblogs] => 9 [inboundlinks] => 11 [lastupdate] => 2005-04-15 19:44:46 GMT [rank] => 50688 [lat] => 0 [lon] => 0 [lang] => 26110 ) ) [3] => Array ( [weblog] => Array ( [name] => a work on process [url] => http://jystewart.net/process [rssurl] => http://jystewart.net/process/feed/ [atomurl] => http://jystewart.net/process/feed/atom/ [inboundblogs] => 3 [inboundlinks] => 3 [lastupdate] => 2005-08-31 20:44:38 GMT [rank] => 132735 [lat] => 0 [lon] => 0 [lang] => 26110 [foafurl] => http://jystewart.net/foaf.rdf ) ) ) ) )]]></programlisting></example> <para> Full details of the XML returned by Technorati is included on the <ulink url="http://developers.technorati.com/wiki/TechnoratiApi">developers' wiki</ulink> </para> </refsect1> </refentry>

« previous php.pear.doc (#6765) next »