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

How can I retrieve my profile information?

Малъ Скрылевъ
  • 16,187
  • 5
  • 56
  • 69
Boti
  • 3,275
  • 1
  • 29
  • 54

1 Answers1

2

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
Малъ Скрылевъ
  • 16,187
  • 5
  • 56
  • 69