Skip to content

Commit

Permalink
Add User#recommendations method
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Aug 22, 2011
1 parent a2869f2 commit 52d13cd
Show file tree
Hide file tree
Showing 4 changed files with 885 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/twitter/client/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,25 @@ def followers(*args)
end
format.to_s.downcase == 'xml' ? response['users_list'] : response
end

# Returns recommended users for the authenticated user
#
# @note {https://dev.twitter.com/discussions/1120 Undocumented}
# @rate_limited Yes
# @requires_authentication Yes
# @response_format `json`
# @response_format `xml`
# @param options [Hash] A customizable set of options.
# @option options [Integer] :limit (20) Specifies the number of records to retrieve.
# @option options [String] :excluded Comma-separated list of user IDs to exclude.
# @return [Array]
# @example Return recommended users for the authenticated user
# Twitter.recommendations
def recommendations(options={})
options[:excluded] = options[:excluded].join(',') if options[:excluded].is_a?(Array)
response = get('users/recommendations', options)
format.to_s.downcase == 'xml' ? response['userrecommendations'] : response
end
end
end
end
1 change: 1 addition & 0 deletions spec/fixtures/recommendations.json

Large diffs are not rendered by default.

Loading

0 comments on commit 52d13cd

Please sign in to comment.