Services_Twitter@PEAR本家 の機能足りてないから足した
- Services_Twitter (version 0.2.1)
@付きの発言をとるインターフェースがなかったから機能たしてみたんで、せっかくなのでパッチつくって、本家にレポートいれてみた。MLにもメールなげたりしたほうがいいんだろうか?まあ、レポートからメールでnotice飛んでるよね。。よね。。。?よくわからん。
初めて英語でレポートしたもんで、英語とかよくわからないし勝手もよくわからないんだけど、まあパッチ添付しておいたから、問題ないよね。多分。
とりあえず、待ち。
ちなみにパッチ。
Index: Twitter/Statuses.php =================================================================== --- Twitter/Statuses.php (revision 976) +++ Twitter/Statuses.php (working copy) @@ -156,6 +156,39 @@ } /** + * Get statuses/mentions + * + * + * @param array $params Parameters array + * + * @return object Instance of SimpleXMLElement of new status + * @throws Services_Twitter_Exception + * @see Services_Twitter_Common::sendRequest() + */ + public function mentions(array $params = array()) + { + $allowed = array('since_id', 'page'); + $tmp = array(); + foreach ($params as $key => $val) { + if (in_array($key, $allowed)) { + $tmp[$key] = $val; + } + } + + $endPoint = '/statuses/mentions'; + + $res = $this->sendRequest($endPoint, $tmp); + if (!isset($res->status) || + (is_array($res->status) && !count($res->status))) { + throw new Services_Twitter_Exception( + $this->user . " has no status updates" + ); + } + + return $res; + } + + /** * Returns up to 100 of the user's friends * * @param array $params Parameters array
オプション指定するメソッドとかつくっとけばいいのに・・・とか思いつつ、いや、なんかそもそも設計がダサくないか、とか思いつつ、でもインターフェース的にはそんなに使いにくいわけではないし、まあいいのかなーとか思いつつ。
俺は @ 付き発言がとれればそれでいいのだ!
参考
そうそう。おいらがそうたろうに文句を言って、 @dlt の出力を変えてもらったので、みんなもぜひ follow するといいですよ。フレンドリーになりました。
Twitter / riaf: そうそう。おいらがそうたろうに文句を言って、 @dlt の出 ...