Module: Twitter::API::SuggestedUsers

Includes:
Utils
Included in:
Client
Defined in:
lib/twitter/api/suggested_users.rb

Constant Summary

Constants included from Utils

Utils::DEFAULT_CURSOR

Instance Method Summary collapse

Instance Method Details

#suggest_users(slug, options = {}) ⇒ Array<Twitter::User>

Access the users in a given category of the Twitter suggested user list and return their most recent Tweet if they are not a protected user

Examples:

Return the users in the Art & Design category and their most recent Tweet if they are not a protected user

Twitter.suggest_users("art-design")

Parameters:

  • slug (String)

    The short name of list or a category.

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

    A customizable set of options.

Returns:

See Also:

Authentication:

  • Requires user context

Rate Limited?:

  • Yes



49
50
51
# File 'lib/twitter/api/suggested_users.rb', line 49

def suggest_users(slug, options={})
  objects_from_response(Twitter::User, :get, "/1.1/users/suggestions/#{slug}/members.json", options)
end

#suggestions(options = {}) ⇒ Array<Twitter::Suggestion> #suggestions(slug, options = {}) ⇒ Array<Twitter::Suggestion>

Overloads:

Returns:

Raises:

Authentication:

  • Requires user context

Rate Limited?:

  • Yes



30
31
32
33
34
35
36
37
# File 'lib/twitter/api/suggested_users.rb', line 30

def suggestions(*args)
  arguments = Twitter::API::Arguments.new(args)
  if slug = arguments.pop
    object_from_response(Twitter::Suggestion, :get, "/1.1/users/suggestions/#{slug}.json", arguments.options)
  else
    objects_from_response(Twitter::Suggestion, :get, "/1.1/users/suggestions.json", arguments.options)
  end
end