From 1ad3ae374733a11ba7a17eaddbec8db8a1b96703 Mon Sep 17 00:00:00 2001 From: Dalton Williams Date: Sat, 5 Oct 2024 10:23:44 -0500 Subject: [PATCH] Increment version --- cmd/aocli/updater.go | 2 +- internal/api/api.go | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/cmd/aocli/updater.go b/cmd/aocli/updater.go index 5357b89..39a5d63 100644 --- a/cmd/aocli/updater.go +++ b/cmd/aocli/updater.go @@ -20,7 +20,7 @@ import ( ) // Internally tracked version to compare against GitHub releases -const currentVersion = "v0.9.9" +const currentVersion = "v0.9.10" const repoURL = "https://api.github.com/repos/DaltonSW/aocGo/releases/latest" const updateMessage = "\nNew version available! Run `aocli update` to get the new version (or `sudo aocli update` if your executable is in a protected location)" diff --git a/internal/api/api.go b/internal/api/api.go index 3d7f7f1..5d1213d 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -13,6 +13,7 @@ import ( "golang.org/x/time/rate" ) +// USER_AGENT is used to identify requests from this program const USER_AGENT = "go.dalton.dog/aocgo" const BASE_URL = "https://adventofcode.com" const YEAR_URL = BASE_URL + "/%v" @@ -83,7 +84,7 @@ func NewGetReq(url string, sessionToken string) (*http.Response, error) { // SubmitAnswer will submit an answer to a puzzle on behalf of a given user token. func SubmitAnswer(year int, day int, part int, userSession string, answer string) (*http.Response, error) { - URL := PuzzleAnswerURL(year, day) + URL := puzzleAnswerURL(year, day) log.Debugf("Attempting to submit answer for Day %v (%v) [Part %v] to URL %v", day, year, part, URL) log.Debugf("Answer: %v -- User: %v", answer, userSession) @@ -107,14 +108,6 @@ func SubmitAnswer(year int, day int, part int, userSession string, answer string // URL Helper Methods -func PuzzlePageURL(year int, day int) string { - return fmt.Sprintf(DAY_URL, year, day) -} - -func PuzzleInputURL(year int, day int) string { - return fmt.Sprintf(DAY_URL, year, day) + "/input" -} - -func PuzzleAnswerURL(year int, day int) string { +func puzzleAnswerURL(year int, day int) string { return fmt.Sprintf(DAY_URL, year, day) + "/answer" }