Twitter4R Twitter::ForbiddenError

2012年1月20日 Posted by PURGE

Twitter4Rを使用して開発を進めていたが、どうしても下記の現象で諦めざるを得ない状況となったようだ。

twitter = Twitter::Client.new(oauth_access: { key: token, secret: token_secret})

#これらのメソッドは動作する
twitter.status(:post, "POST TEST!!!")
twitter.friend(:add, "twitter_user")

#これらのメソッドは ForbiddenErrorとなる
friends = twitter.my(:friends)
friends = twitter.user.friends

結局、twitter4r(0.7.0) をアンインストールし、twitter-2.0.2 を代わりにインストールして再開発。これでうまくいくのかわからないが、取りたかった情報(friends/ids)は取れた。

後日、記述予定。

C:works>gem list twitter
*** LOCAL GEMS ***
twitter4r (0.7.0)

C:works>gem uninstall twitter4r
Remove executables:
        t4rsh, t4r-oauth-access

in addition to the gem? [Yn]  y
Removing t4rsh
Removing t4r-oauth-access
Successfully uninstalled twitter4r-0.7.0

C:works>gem install twitter
Fetching: addressable-2.2.6.gem (100%)
Fetching: multipart-post-1.1.4.gem (100%)
Fetching: faraday-0.7.5.gem (100%)
Fetching: simple_oauth-0.1.5.gem (100%)
Fetching: twitter-2.0.2.gem (100%)
********************************************************************************

  You should follow @gem on Twitter for announcements and updates about the gem.
  https://twitter.com/gem

  Please direct any questions about the library to the mailing list.
  https://groups.google.com/group/ruby-twitter-gem

  Does your project or organization use this gem? Add it to the apps wiki!
  https://github.com/jnunemaker/twitter/wiki/apps

********************************************************************************
Successfully installed addressable-2.2.6
Successfully installed multipart-post-1.1.4
Successfully installed faraday-0.7.5
Successfully installed simple_oauth-0.1.5
Successfully installed twitter-2.0.2
5 gems installed

stackoverflow.com

One Response to Twitter4R Twitter::ForbiddenError

  1. 通りすがり says:

    やっぱりそうなりますよね・・いくらやってもエラー出てしまって。

    Twitterの更新に、ライブラリが追いついていない。

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です