module LittleLight::User
Public Instance Methods
# File lib/little_light/user.rb, line 3 def get_bungie_net_profile(bungieMembershipId) data = self.class.get( "/User/GetBungieNetUserById/#{bungieMembershipId}/", headers: @headers ) end
only 200 query strings will produce results here for query strings that return a JSON object that has a key of privacy pointing to 2 - means that user need to be authenticated via OAuth 2.0 or user has privacy settings on. No real plans to implement OAuth in this gem.
# File lib/little_light/user.rb, line 104 def get_character(destinyMembershipId, membershipType, characterId, component) data = self.class.get( "/Destiny2/#{membershipType}/Profile/#{destinyMembershipId}"\ "/Character/#{characterId}?components=#{component}", headers: @headers ) end
returns the same as the method above, doesn't require any parms to be passed in but does require a user to be signed in via Oauth2
# File lib/little_light/user.rb, line 42 def get_current_user_membership data = self.class.get( "/User/GetMembershipsForCurrentUser/", headers: @headers ) end
only 100 & 200 query strings will produce results here
# File lib/little_light/user.rb, line 90 def get_destiny_profile(destinyMembershipId, membershipType, component) data = self.class.get( "/Destiny2/#{membershipType}/Profile/#{destinyMembershipId}"\ "?components=#{component}", headers: @headers ) end
groupType 0 - general, 1 - clan filter 0 - All, 1 - Founded, 2 - Not Founded
# File lib/little_light/user.rb, line 77 def get_groups_for_user(destinyMembershipId, membershipType, groupType, filter) data = self.class.get( "/GroupV2/User/#{membershipType}/#{destinyMembershipId}"\ "/#{filter}/#{groupType}/", headers: @headers ) end
returns the stats of a specific item instance
# File lib/little_light/user.rb, line 113 def get_item(destinyMembershipId, membershipType, itemInstanceId) data = self.class.get( "/Destiny2/{membershipType}/Profile/{destinyMembershipId}/Item/"\ "{itemInstanceId}/", headers: @headers ) end
# File lib/little_light/user.rb, line 66 def get_linked_profiles(destinyMembershipId, membershipType) data = self.class.get( "/Destiny2/#{membershipType}/Profile/#{destinyMembershipId}"\ "/LinkedProfiles/", headers: @headers ) end
basically returns a combination of both search_bungie_net_by_username
&& search_destiny_player
however the destinyMembershipId is needed to access this endpoint (which you can only really get from search_destiny_player
)
# File lib/little_light/user.rb, line 33 def get_user_by_membership(destinyMembershipId, membershipType) data = self.class.get( "/User/GetMembershipsById/#{destinyMembershipId}/#{membershipType}/", headers: @headers ) end
# File lib/little_light/user.rb, line 131 def get_user_clan_avatar data = self.class.get( "/GroupV2/GetAvailableAvatars/", headers: @headers ) end
the next two get_user methods return info relevant to the specific clans they're in but are user methods not clan methods
# File lib/little_light/user.rb, line 123 def get_user_clan_theme data = self.class.get( "/GroupV2/GetAvailableThemes/", headers: @headers ) end
# File lib/little_light/user.rb, line 58 def get_user_partnerships(destinyMembershipId) data = self.class.get( "/User/#{destinyMembershipId}/Partnerships/", headers: @headers ) end
# File lib/little_light/user.rb, line 50 def get_user_themes data = self.class.get( "/User/GetAvailableThemes/", headers: @headers ) end
returns a JSON object of potential users that match the given username gives basic overview of returned users, returns bungie.net membershipID but no Destiny membershipID
# File lib/little_light/user.rb, line 13 def search_bungie_net_by_username(username) data = self.class.get( "/User/SearchUsers?q=#{username}", headers: @headers ) end
returns only the exact user on the given platform or nothing basically just gives the Destiny membershipID displayName is either GamerTag or PSN Name
# File lib/little_light/user.rb, line 24 def search_destiny_player(displayName, membershipType) data = self.class.get( "/Destiny2/SearchDestinyPlayer/#{membershipType}/#{displayName}/", headers: @headers ) end