print json output for id

This commit is contained in:
Zynh0722 2024-01-31 23:48:09 -08:00
parent 7fa573613d
commit 5419a77c48

43
main.go
View file

@ -1,40 +1,15 @@
package main package main
import ( import (
"encoding/json"
"fmt"
"log" "log"
"slices"
"github.com/karashiiro/bingode" "github.com/karashiiro/bingode"
"github.com/xivapi/godestone/v2" "github.com/xivapi/godestone/v2"
) )
func main() { func main() {
ignore := []string{
"Carpenter",
"Blacksmith",
"Armorer",
"Goldsmith",
"Leatherworker",
"Weaver",
"Alchemist",
"Culinarian",
"Miner",
"Botanist",
"Fisher",
}
base_levels := make(map[string]int)
base_levels["Dark Knight"] = 30
base_levels["Astrologian"] = 30
base_levels["Machinist"] = 30
base_levels["Red Mage"] = 50
base_levels["Samurai"] = 50
base_levels["Gunbreaker"] = 60
base_levels["Dancer"] = 60
base_levels["Reaper"] = 70
base_levels["Sage"] = 70
s := godestone.NewScraper(bingode.New(), godestone.EN) s := godestone.NewScraper(bingode.New(), godestone.EN)
c, err := s.FetchCharacter(29932586) c, err := s.FetchCharacter(29932586)
@ -42,16 +17,6 @@ func main() {
log.Fatalln(err) log.Fatalln(err)
} }
total := 0 data, _ := json.Marshal(c.ClassJobs)
for _, v := range c.ClassJobs { fmt.Printf("%s\n", data)
if v.Name != "Scholar" && !slices.Contains(ignore[:], v.Name) {
base_level, ok := base_levels[v.Name]
if !ok {
base_level = 0
}
total += int(v.Level) - base_level
}
}
println(total)
} }