Twitter4R Twitter::ForbiddenError

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

[ruby]
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
[/ruby]

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

後日、記述予定。

[bash]
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.

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
[/bash]

stackoverflow.com

This entry was posted in Ruby, twitter, 技術情報. Bookmark the permalink.

One Response to Twitter4R Twitter::ForbiddenError

コメントを残す

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