Twitterの検索APIのやっかいな問題

Twitterの検索APIについて、やっかいな問題にぶちあたりました。(2010年4月29日現在)

APIの結果に、ツイートのfrom_user_idとto_user_idという値が入っています。誰の発言したツイートか(from_user_id)と誰宛のツイートか(to_user_id)という数値で、当然twitterのユーザーIDが入ってくるものだと思っていたのですが、どうもバグがあるらしく、時折いい加減な数字が返ってきてしまいます。。

GET search http://dev.twitter.com/doc/get/search

Warning: The user ids in the Search API are different from those in the REST API (about the two APIs). This defect is being tracked by Issue 214. This means that the to_user_id and from_user_id field vary from the actualy user id on Twitter.com. Applications will have to perform a screen name-based lookup with the users/show method to get the correct user id if necessary.

この問題はすでに報告されていて、現在追跡中です。 ちなみにこのバグは2008年のクリスマスイブに報告されているので・・・。

対応としてはfrom_userとto_userにtwitterのscreen_name(僕のアカウントならfunc09みたいな)が入っているので、それを users/show APIを使って調べてね。とのこと。

twitterはAPIの制限もあるし、全部問い合せるわけにもいかず、超困るんですけど・・。

とりあえず検索APIのfrom_user_idとto_user_idは信用するなということですね。

関連記事

  1. [Sinatra] Sinatraでnamespaceルート(嘘)
  2. [rails] map.resourcesでいらないアクションを外す
  3. Facebooker のユーザー情報取得とキャッシュの仕組みを調べたメモ
  4. Ruby on Rails2.3RC1のNested Object Forms を試してみた
  5. [Rails] PaperClipを使って本番の時だけAmazon S3を使う
Posted in 日記 at 4月 29th, 2010. Trackback URI: trackback

No Responses to “Twitterの検索APIのやっかいな問題”

Leave a Reply