3 # gem('twitter4r', '0.2.0')
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')
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)
16 # The purpose of the <b>Model API</b> is to make Twitter REST methods
17 # integrated into class and instance methods that resemble
18 # <tt>ActiveRecord</tt> class API.
21 # For example, suppose we want to create a new direct message to a friend:
22 # message = Twitter::Message.create(
23 # :text => 'Ich liebe dich!',
25 # :recipient => 'myspouse')
27 # We can also create a new status message, which updates our (the
28 # authenticated user's) timeline:
29 # status = Twitter::Status.create(
30 # :text => 'Doing early Christmas shopping in July',
33 # Notice we must always pass in a <tt>:client</tt> key-value pair giving
34 # the client context object.
36 # There is currently no useful Twitter::User.create implementation as
37 # <tt>Twitter</tt> does not provide this server REST API. This is *not*
38 # a <tt>Twitter4R</tt> limitation. Please harass the Twitter.com/Obvious
39 # developer for this not me please.
42 # We can also use finder methods that look very similar to
43 # <tt>ActiveRecord</tt> style classes:
44 # user = Twitter::User.find('myfriend', twitter)
45 # status = Twitter::Status.find(status.id, twitter)
47 # There is currently no useful Twitter::Message.find implementation as
48 # <tt>Twitter</tt> does not provide this server REST API. Ths is *not*
49 # a <tt>Twitter4R</tt> limitation. Please harass the Twitter.com/Obvious
50 # developer for this not me please.
52 # == Domain Specific Methods
53 # <tt>Twitter::User</tt> has a few domain specific methods for convenience:
54 # user.is_me? # => false since <tt>user</tt> is 'myfriend' not authenticated user
55 # me = Twitter::User.find('mylogin')
56 # me.is_me? # => true since <tt>me</tt> is authenticated user
57 # me.followers # => return Array of followers for authenticated user (only available for authenticated user)
58 # me.friends # => returns Array of friends for that user instance
59 # me.befriend(user) # => user (only available for authenticated user)
60 # me.defriend(user) # => user (only available for authenticated user)