2
client = Twitter::REST::Client.new do |config|
  config.consumer_key        = "XX"
  config.consumer_secret     = "XY"
  config.access_token        = "ZZ"
  config.access_token_secret = "ZZZ"
end

如何检索我的个人资料信息?

4

1 回答 1

2

您可以执行以下简单步骤来使用Twitter客户端 gem:

# get user id from user name 
id = client.user( 'user_name' ).id

# read user's timeline by id
timeline = client.user_timeline id

# read user's timeline of yours
your_timeline = client.user_timeline

您可以省略用户名,并获得当前用户的时间线,因此也尝试发出:

user_info = client.user
于 2014-01-27T11:22:37.087 回答