Module: OauthTwitter::API::Statuses

Included in:
OauthTwitter
Defined in:
lib/oauth_twitter/api/statuses.rb

Constant Summary collapse

PATH =

Url path of status API

{
  :mentions_timeline => '/1.1/statuses/mentions_timeline.json',
  :user_timeline     => '/1.1/statuses/user_timeline.json',
  :home_timeline     => '/1.1/statuses/home_timeline.json',
  :retweets_of_me    => '/1.1/statuses/retweets_of_me.json'
}

Instance Method Summary collapse

Instance Method Details

#home_timeline(params = {}, options = {}) ⇒ Array

Load current use’s (determined by oauth_token and oauth_token_secret variables) home time.

Parameters:

  • params (Hash) (defaults to: {})

    parameters that consistent with Twitter’s API.

  • options (Hash) (defaults to: {})

    options to perform more operations.

    :pages => [Int] indicate many pages will return, for example, if count = 5, pages = 3, then it will return 5 * 3 = 15 tweets from the user’s timeline. Cursor stops if response no more reponse.

    :detailed => [Bool] if false, will return just the data

Returns:

  • (Array)

    hash structured the same as Twitter’s JSON response.



49
50
51
52
# File 'lib/oauth_twitter/api/statuses.rb', line 49

def home_timeline(params={}, options={})
  query = params.clone
  return send_status_request(:home_timeline, query, options)
end

#mentions_timeline(params = {}, options = {}) ⇒ Array

Load current user’s Tweet with @user_name mentioned, include user mention themselves.

Parameters:

  • params (Hash) (defaults to: {})

    always supply a user_id or screen_name. If both are supplied, user_id will be used

  • options (Hash) (defaults to: {})

Returns:

  • (Array)


23
24
25
26
# File 'lib/oauth_twitter/api/statuses.rb', line 23

def mentions_timeline(params={}, options={})
  query = params.clone
  return send_status_request(:mentions_timeline, query, options)
end

#retweets_of_me(params = {}, options = {}) ⇒ Object



56
57
58
59
# File 'lib/oauth_twitter/api/statuses.rb', line 56

def retweets_of_me(params={}, options={})
  query = params.clone
  return send_status_request(:retweets_of_me, query, options)
end

#user_timeline(params = {}, options = {}) ⇒ Object



30
31
32
33
# File 'lib/oauth_twitter/api/statuses.rb', line 30

def user_timeline(params={}, options={})
  query = params.clone
  return send_status_request(:user_timeline, query, options)
end