print json output for id
This commit is contained in:
parent
7fa573613d
commit
5419a77c48
1 changed files with 4 additions and 39 deletions
43
main.go
43
main.go
|
@ -1,40 +1,15 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"slices"
|
||||
|
||||
"github.com/karashiiro/bingode"
|
||||
"github.com/xivapi/godestone/v2"
|
||||
)
|
||||
|
||||
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)
|
||||
|
||||
c, err := s.FetchCharacter(29932586)
|
||||
|
@ -42,16 +17,6 @@ func main() {
|
|||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
total := 0
|
||||
for _, v := range c.ClassJobs {
|
||||
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)
|
||||
data, _ := json.Marshal(c.ClassJobs)
|
||||
fmt.Printf("%s\n", data)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue