Module: Skyhook::Core::ISteamUserStats

Defined in:
lib/skyhook/i_steam_user_stats.rb

Class Method Summary collapse

Class Method Details

.global_achievenement_percentages(appid) ⇒ Object



35
36
37
38
39
# File 'lib/skyhook/i_steam_user_stats.rb', line 35

def self.global_achievenement_percentages( appid )

  response = parent.request '/ISteamUserStats/GetGlobalAchievementPercentagesForApp/v0002', gameid: appid
  response['achievementpercentages']['achievements']
end

.global_stats(appid, count = 1, options = {}) ⇒ Object

FIXME(ClikeX) this won’t work without names. But names do use the [] url parameter encoding. This won’t work with faraday



28
29
30
31
32
33
# File 'lib/skyhook/i_steam_user_stats.rb', line 28

def self.global_stats( appid, count = 1, options = {} )
  startdate = options[:startdate]
  enddate = options[:enddate]

  parent.request '/ISteamUserStats/GetGlobalStatsForGame/v0001', appidid: appid, count: count, startdate: startdate, enddate: enddate
end

.number_of_current_players(appid) ⇒ Object



22
23
24
25
# File 'lib/skyhook/i_steam_user_stats.rb', line 22

def self.number_of_current_players( appid )
  response = parent.request '/ISteamUserStats/GetNumberOfCurrentPlayers/v1', appid: appid
  response['response']['player_count']
end

.player_achievements(appid, steamid, options = {}) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/skyhook/i_steam_user_stats.rb', line 14

def self.player_achievements( appid, steamid, options = {} )
  steamid = Skyhook::Core::ISteamUser.resolve_vanity steamid
  l = options[:l] || options[:language]

  response = parent.request '/ISteamUserStats/GetPlayerAchievements/v1', appid: appid, steamid: steamid, l: l
  response['playerstats']
end

.player_stats(appid, steamid) ⇒ Object

ISteamUserStats Methods relating to User stats.



7
8
9
10
11
12
# File 'lib/skyhook/i_steam_user_stats.rb', line 7

def self.player_stats( appid, steamid )
  steamid = Skyhook::Core::ISteamUser.resolve_vanity steamid

  response = parent.request '/ISteamUserStats/GetUserStatsForGame/v2', steamid: steamid, appid: appid
  response['playerstats']
end

.schema_for_game(appid, options = {}) ⇒ Object



41
42
43
44
45
46
# File 'lib/skyhook/i_steam_user_stats.rb', line 41

def self.schema_for_game(appid, options = {})
  l = options[:l] || options[:language]

  result = parent.request '/ISteamUserStats/GetSchemaForGame/v2', appid: appid, l: l
  result['game']
end