Added v 0.2.3 snapshot.
[twitter4r-core.git] / examples / friendship.rb
blob8a09d4f0a64152a061b8ce9551c3f84ebf2ab2f7
1 # = Friendship API Examples
2 #  require('rubygems')
3 #  gem('twitter4r', '0.2.0')
4 #  require('twitter')
5
6 # The following is only required if you want to use some configuration 
7 # helper methods like <tt>Twitte4R::Client.from_config</tt> for 
8 # sensitive/instance context.
9 #  require 'twitter/console'
10 #  config_file = File.join(File.dirname(__FILE__), '..', 'config', 'twitter.yml')
11 #  
12 # To override client connection configuration please refer to 
13 # the {<tt>configure.rb</tt>}[file:configure_rb.html] example code.
14 #  twitter = Twitter::Client.from_config(config_file)
15
16 # To add a friend to the authenticated user's list of friends using the 
17 # client context object you can do:
18 #  twitter.friend(:add, 'otherlogin')
19 # You may also pass in the unique integer user ID or the Twitter::User object
20 # representation of the user you wish to 'friend'.  For example:
21 #  user = twitter.user('otherlogin')
22 #  twitter.friend(:add, user)
23 # OR
24 #  twitter.friend(:add, user.id)
25
26 # To remove a friend from the authenticated user's list of friends using the 
27 # client context object you can do:
28 #  twitter.friend(:remove, 'otherlogin')
29 # As with the case of adding a new friend, you can use the unique integer user 
30 # ID or the Twitter::User object representation of the user you wish to remove
31 # as a friend.  See above "add" examples and replace ":add" with ":remove" for 
32 # desired effect.