Services_Technorati (Previous) (Next) Services_W3C_HTMLValidator

View this page in Last updated: Sun, 31 Aug 2008
English | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Plain HTML

導入およびクイックスタート

導入およびクイックスタート -- Services_Technorati の概要

説明

Technorati は、blog の検索エンジンです。 blog をインデックス化して blog 間のリンクを探索することにより、オンラインでの会話や blog 間での やりとりをモニタする仕組みを提供します。 REST ベースの API を使用する ことにより、この手の情報の中ではもっとも豊富な情報を得ることが可能と なります。このモジュールでは、PHP から使用するためのオブジェクト指向の インターフェイスを提供します。 Technorati API の完全なドキュメントは、 開発者用 wiki にあります。 この API を使用するには、 API キー が必要です。

将来の API 側での仕様変更に対応するため、このモジュールへのアクセスには ファクトリメソッドを使用します。


<?php
$tapi =& Services_Technorati::factory($api_key);
?>

Technorati API は、1 日あたりのクエリの総数を 500 に制限しています。 そのため、頻繁に使用される環境などでは、何らかのキャッシュの仕組みが欲しくなることでしょう。 Services_Technorati は、Cache_Lite 風の API によるキャッシュシステムをサポートしています。 キャッシュを使用するには、それを作成した上でファクトリ内でクラスに渡します。


<?php
$tapi =& Services_Technorati::factory($api_key$cache_object);
?>

オブジェクトのインスタンスを作成すると、クエリを渡すことが可能になります。 クエリの呼び出しは methodName(keyParameter, options) のような形式となり、 オプションは配列で渡します。

(注意。 Technorati の attention.XML サービスへのサポートも 仕様どおりに組み込まれていますが、このサービス自体がまだ流動的な状態ですので これに頼ることはできません。)

クエリから返される値は、シリアライズされていない XML を表す配列または PEAR_Error です。

例 67-1 ('jystewart' を指定して) blogInfo クエリを実行した場合の結果の例


<?php
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 (wifiin grand rapidsmichigan
                                    [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
                                )
                        )
                )
        )
)
?>

Technorati が返す XML の詳細は、 開発者用 wiki にあります。

Services_Technorati (Previous) (Next) Services_W3C_HTMLValidator

Download Documentation Last updated: Sun, 31 Aug 2008
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.