2023-10-27 19:02:38 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2023-11-14 22:42:25 -05:00
|
|
|
"flag"
|
|
|
|
"fmt"
|
2023-10-27 19:02:38 -04:00
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2023-11-07 00:21:48 -05:00
|
|
|
var base_link string
|
2023-11-14 18:04:29 -05:00
|
|
|
var base_aplus_link string
|
2023-11-07 00:21:48 -05:00
|
|
|
var token string
|
2023-11-14 04:23:18 -05:00
|
|
|
var external_tools_code int
|
2023-11-13 02:08:03 -05:00
|
|
|
var client http.Client
|
2023-11-07 00:21:48 -05:00
|
|
|
|
2023-10-27 19:02:38 -04:00
|
|
|
func main() {
|
2023-11-07 00:21:48 -05:00
|
|
|
initialize()
|
2023-11-04 01:55:30 -04:00
|
|
|
|
2023-11-14 22:42:25 -05:00
|
|
|
code := flag.String("code", "", "Code to enter")
|
|
|
|
course := flag.Int("course", -1, "Canvas course number")
|
|
|
|
list_all := flag.Bool("list-all", false, "List all courses")
|
|
|
|
list_favorites := flag.Bool("list-favorites", false, "List favorite courses")
|
2023-10-30 17:58:38 -04:00
|
|
|
|
2023-11-14 22:42:25 -05:00
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
if *list_all {
|
|
|
|
list_all_courses()
|
|
|
|
}
|
|
|
|
|
|
|
|
if *list_favorites {
|
|
|
|
list_favorite_courses()
|
|
|
|
}
|
|
|
|
|
|
|
|
if *code != "" && *course != -1 {
|
|
|
|
fmt.Printf("%d %s", *course, *code)
|
|
|
|
submit_code(*course, *code)
|
|
|
|
}
|
|
|
|
|
|
|
|
submit_code(7329, "asdkl")
|
2023-11-04 01:55:30 -04:00
|
|
|
}
|