module LittleLight::User

Public Instance Methods

get_bungie_net_profile(bungieMembershipId) click to toggle source
# File lib/little_light/user.rb, line 3
def get_bungie_net_profile(bungieMembershipId)
  data = self.class.get(
    "/User/GetBungieNetUserById/#{bungieMembershipId}/",
     headers: @headers
   )
end
get_character(destinyMembershipId, membershipType, characterId, component) click to toggle source

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
get_current_user_membership() click to toggle source

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
get_destiny_profile(destinyMembershipId, membershipType, component) click to toggle source

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
get_groups_for_user(destinyMembershipId, membershipType, groupType, filter) click to toggle source

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
get_item(destinyMembershipId, membershipType, itemInstanceId) click to toggle source

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
get_linked_profiles(destinyMembershipId, membershipType) click to toggle source
# 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
get_user_by_membership(destinyMembershipId, membershipType) click to toggle source

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
get_user_clan_avatar() click to toggle source
# File lib/little_light/user.rb, line 131
def get_user_clan_avatar
  data = self.class.get(
    "/GroupV2/GetAvailableAvatars/",
    headers: @headers
  )
end
get_user_clan_theme() click to toggle source

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
get_user_partnerships(destinyMembershipId) click to toggle source
# File lib/little_light/user.rb, line 58
def get_user_partnerships(destinyMembershipId)
  data = self.class.get(
    "/User/#{destinyMembershipId}/Partnerships/",
    headers: @headers
   )
end
get_user_themes() click to toggle source
# File lib/little_light/user.rb, line 50
def get_user_themes
  data = self.class.get(
    "/User/GetAvailableThemes/",
    headers: @headers
  )
end
search_bungie_net_by_username(username) click to toggle source

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
search_destiny_player(displayName, membershipType) click to toggle source

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