aboutsummaryrefslogtreecommitdiff
path: root/rankings/fetch.go
diff options
context:
space:
mode:
Diffstat (limited to 'rankings/fetch.go')
-rw-r--r--rankings/fetch.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/rankings/fetch.go b/rankings/fetch.go
index cf04e81..7e63427 100644
--- a/rankings/fetch.go
+++ b/rankings/fetch.go
@@ -12,9 +12,9 @@ import (
12 "strings" 12 "strings"
13) 13)
14 14
15func fetchLeaderboard(records []Record, overrides map[string]map[string]int, useCache bool) map[string]*Player { 15func fetchLeaderboard(records []Record, overrides map[SteamID]map[string]int, useCache bool) map[SteamID]*Player {
16 log.Println("fetching leaderboard") 16 log.Println("fetching leaderboard")
17 players := map[string]*Player{} 17 players := map[SteamID]*Player{}
18 // first init players map with records from portal gun and doors 18 // first init players map with records from portal gun and doors
19 fetchAnotherPage := true 19 fetchAnotherPage := true
20 start := 0 20 start := 0
@@ -187,7 +187,7 @@ func fetchPlayerInfo(players []*Player) {
187 187
188 ids := make([]string, len(players)) 188 ids := make([]string, len(players))
189 for _, player := range players { 189 for _, player := range players {
190 ids = append(ids, player.SteamID) 190 ids = append(ids, strconv.FormatInt(int64(player.SteamID), 10))
191 } 191 }
192 192
193 url := fmt.Sprintf("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=%s&steamids=%s", os.Getenv("API_KEY"), strings.Join(ids, ",")) 193 url := fmt.Sprintf("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/?key=%s&steamids=%s", os.Getenv("API_KEY"), strings.Join(ids, ","))
@@ -200,9 +200,9 @@ func fetchPlayerInfo(players []*Player) {
200 log.Fatalln(err.Error()) 200 log.Fatalln(err.Error())
201 } 201 }
202 type PlayerSummary struct { 202 type PlayerSummary struct {
203 SteamID string `json:"steamid"` 203 SteamID SteamID `json:"steamid"`
204 PersonaName string `json:"personaname"` 204 PersonaName string `json:"personaname"`
205 AvatarFull string `json:"avatarfull"` 205 AvatarFull string `json:"avatarfull"`
206 } 206 }
207 207
208 type Result struct { 208 type Result struct {