Question

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

How can I retrieve my profile information?

Was it helpful?

Solution

You can do the following simple steps to use the Twitter client 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

you can omit the username, and you get the timeline of current user, so try also to issue:

user_info = client.user
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top