aboutsummaryrefslogtreecommitdiff
path: root/rankings/export.go
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2024-09-12 00:25:15 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2024-09-12 00:25:15 +0300
commitdf6f6cb5ff8957be8f01d58d60857da2c094a3d9 (patch)
tree5ec5a8a95633d7fa6cce62654a9bc6fc6204f788 /rankings/export.go
parentrefactor: fix module ver (diff)
downloadlphub-df6f6cb5ff8957be8f01d58d60857da2c094a3d9.tar.gz
lphub-df6f6cb5ff8957be8f01d58d60857da2c094a3d9.tar.bz2
lphub-df6f6cb5ff8957be8f01d58d60857da2c094a3d9.zip
refactor: unofficial rankings implementation
Diffstat (limited to 'rankings/export.go')
-rw-r--r--rankings/export.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/rankings/export.go b/rankings/export.go
new file mode 100644
index 0000000..20dfebe
--- /dev/null
+++ b/rankings/export.go
@@ -0,0 +1,21 @@
1package main
2
3import (
4 "encoding/json"
5 "os"
6)
7
8func exportAll(spRankings, mpRankings, overallRankings *[]*Player) {
9 sp, _ := os.Create("./output/sp.json")
10 spRankingsOut, _ := json.Marshal(*spRankings)
11 sp.Write(spRankingsOut)
12 sp.Close()
13 mp, _ := os.Create("./output/mp.json")
14 mpRankingsOut, _ := json.Marshal(*mpRankings)
15 mp.Write(mpRankingsOut)
16 mp.Close()
17 overall, _ := os.Create("./output/overall.json")
18 overallRankingsOut, _ := json.Marshal(*overallRankings)
19 overall.Write(overallRankingsOut)
20 overall.Close()
21}