From 6b0ed0f177f051961d45f7b6eaf120911c651331 Mon Sep 17 00:00:00 2001 From: vin Date: Tue, 21 Nov 2023 11:07:28 -0500 Subject: add verbose flag --- aplus.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'aplus.go') diff --git a/aplus.go b/aplus.go index 96fbd92..dfc73e1 100644 --- a/aplus.go +++ b/aplus.go @@ -14,7 +14,9 @@ import ( func submit_code(course_code int, attendance_code string) { cur_body := launch_aplus(course_code) - fmt.Printf("%s", cur_body) + if verbose { + fmt.Printf("%s", cur_body) + } current_url := fmt.Sprintf("%s/student/", base_aplus_link) // the links to submit the code for a class is under the dayPanel div @@ -33,10 +35,12 @@ func submit_code(course_code int, attendance_code string) { link_url := current_url + cur_body[link_start:link_end] link_url = html.UnescapeString(link_url) - fmt.Println("!!!") - fmt.Printf("%i %i %i\n", daypanel_start, link_start, link_end) - fmt.Println(link_url) - fmt.Println("!!!") + if verbose { + fmt.Println("!!!") + fmt.Printf("%i %i %i\n", daypanel_start, link_start, link_end) + fmt.Println(link_url) + fmt.Println("!!!") + } resp, _ := client.Get(link_url) body, _ := io.ReadAll(resp.Body) -- cgit v1.2.3