From 4f316982718231c36ce510004d4c1badb370ae61 Mon Sep 17 00:00:00 2001 From: nuo <49533950+nuoxoxo@users.noreply.github.com> Date: Fri, 27 Sep 2024 10:47:43 +0200 Subject: [PATCH] 16/del --- 16.go | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 16.go diff --git a/16.go b/16.go deleted file mode 100644 index 834a7f5..0000000 --- a/16.go +++ /dev/null @@ -1,42 +0,0 @@ -package main - -import ( - "fmt" - "os" - "io/ioutil" - "net/http" - "strings" - _"regexp" - _"strconv" -) - -func main() { - - URL := "https://challenges.aquaq.co.uk/challenge/16/input.txt" - line := strings.TrimSpace(string(getbody(URL))) - fmt.Println("line/", YELL(line[:42]), CYAN(line[len(line) - 42:])) - - -} - -func getbody(URL string) []uint8 { - session_value := os.Getenv("COOK") - if session_value == "" { - panic("session/empty") - } - conn := &http.Client {} - req, _ := http.NewRequest("GET", URL, nil) - session := &http.Cookie { - Name: "session", - Value: session_value, - } - req.AddCookie( session ) - resp, _ := conn.Do(req) - defer resp.Body.Close() - body, _ := ioutil.ReadAll(resp.Body) - return body -} - -const Yell, Cyan, Rest string = "\033[33m", "\033[36m", "\033[0m" -func YELL(s string)string{ return Yell + s + Rest } -func CYAN(s string)string{ return Cyan + s + Rest }