Remove Debug

Also make sample program useful
This commit is contained in:
Brian Buller 2020-12-18 16:43:47 -06:00
parent cf5d10aaf8
commit b29e554d69
3 changed files with 9 additions and 4 deletions

2
aoc.go
View File

@ -70,8 +70,6 @@ func (a *AoC) fetchLeaderboard(year int) (*Leaderboard, error) {
client := &http.Client{}
boardString := fmt.Sprintf("https://adventofcode.com/%d/leaderboard/private/view/%s.json", year, a.boardId)
fmt.Println(boardString)
req, err = http.NewRequest("GET", boardString, nil)
req.Header.Add("Cookie", "session="+a.session)
resp, err = client.Do(req)

BIN
cmd/cmd

Binary file not shown.

View File

@ -3,7 +3,7 @@ package main
import (
"fmt"
"os"
"time"
"sort"
aoc "git.bullercodeworks.com/brian/go-adventofcode"
)
@ -21,7 +21,14 @@ func main() {
fmt.Println(err)
os.Exit(1)
}
var members []aoc.Member
for _, v := range l.Members {
fmt.Println(v.Name, v.LocalScore, v.LastStarTs.Format(time.RFC3339))
members = append(members, v)
}
sort.Sort(aoc.ByStarsThenScore(members))
for _, v := range members {
fmt.Println(v.Name, v.Stars, v.LocalScore)
}
}