User API Examples

 gem('twitter4r', '0.2.0')

The following is only required if you want to use some configuration helper methods like Twitte4R::Client.from_config for sensitive/instance context.

 require 'twitter/console'
 config_file = File.join(File.dirname(__FILE__), '..', 'config', 'twitter.yml')

To override client connection configuration please refer to the configure.rb example code.

 twitter = Twitter::Client.from_config(config_file)

To get the Twitter::User object representation of a Twitter user we can do:

 user = twitter.user('otherlogin')

To get a list of friends of a specific user on Twitter we can do:

 friends = twitter.user('otherlogin', :friends)

See the Model API for related methods.

To get the authenticated user‘s Twitter::User object representation we can do:

 me =

To get the authenticated user‘s followers (only available for authenticated user):

 followers =


 myuser =
 followers = myuser.followers

See the Model API for more information on this.