Boti Boti - 1 year ago 75
Ruby Question

How can I retrieve my profile with the twitter gem

client = do |config|
config.consumer_key = "XX"
config.consumer_secret = "XY"
config.access_token = "ZZ"
config.access_token_secret = "ZZZ"

How can I retrieve my profile information?

Answer Source

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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download