summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvin <git@vineetk.net>2024-01-16 15:23:35 -0500
committervin <git@vineetk.net>2024-01-16 15:31:04 -0500
commit9221051daefc9f8ee5ecf31a3f6974ee3965869c (patch)
tree7f1ba66d121bbb7b45b0befe1a747e8fed657280
parent102a3ef5f38a1861a98c1a0b4c5a1643006cd663 (diff)
update readme to the current status of the project
-rw-r--r--README.md41
-rw-r--r--canvas.go2
-rw-r--r--main.go2
3 files changed, 39 insertions, 6 deletions
diff --git a/README.md b/README.md
index d74cbad..c76a9a7 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,39 @@
1# aplus command line utility 1# A+Attendance CLI
2 2
3This is an cli utility initially created for students at Florida Polytechnic University to submit their aplus codes. 3This is a CLI utility initially created for students at Florida Polytechnic University to submit their A+ attendance codes, but can be used for other
4In time, we intend to generalize this utility to all universities. 4universities using Canvas and A+Attendance.
5In the meantime however, any students from other universities wishing to use the utility may change the instance_url (the main URL you see before the / when you use Canvas) variables. 5
6## Building/Installing
7
8To compile this program, you need `go` installed as well as need to set two
9environment variables in your shell's configuration file (like `~/.profile` or it's rc file) for your Canvas instance URL and your account's API key.
10
11### Getting an API key
12
13When logged into your university's Canvas site, go to Account -> Settings -> New Access Token -> (give any name or expiration date) -> store the Token somewhere.
14
15### Setting the Environment Variables
16
17In your shell's configuration file, add:
18```sh
19export CANVAS_INSTANCE="https://youruniversityhere.instructure.com"
20export CANVAS_API_KEY="the_canvas_access_token_you_stored_somewhere"
21
22# below not needed if go is already setup
23export GOPATH=$HOME/.local/go
24export GOBIN=$GOPATH/bin
25export PATH=$PATH:$GOBIN
26```
27
28### Installing
29
30Simply run `go install codeberg.org/flpolyaplus/aplus@latest`.
6 31
7## Usage 32## Usage
8 33
34### Show help message
35`aplus --help`
36
9### List all courses and canvas course codes 37### List all courses and canvas course codes
10`aplus --list-all` 38`aplus --list-all`
11 39
@@ -15,6 +43,11 @@ In the meantime however, any students from other universities wishing to use the
15### Enter code for a specified course 43### Enter code for a specified course
16`aplus --code <code> --course <canvas_course_number>` 44`aplus --code <code> --course <canvas_course_number>`
17 45
46If no course is specified, the code is tried on all active courses.
47
48### Show timetable for a specified course
49`aplus --timetable --course <canvas_course_number>`
50
18## Mirrors 51## Mirrors
19[Codeberg](https://codeberg.org/flpolyaplus/aplus/) 52[Codeberg](https://codeberg.org/flpolyaplus/aplus/)
20 53
diff --git a/canvas.go b/canvas.go
index 7020658..f1a2375 100644
--- a/canvas.go
+++ b/canvas.go
@@ -14,7 +14,7 @@ import (
14) 14)
15 15
16func initialize() { 16func initialize() {
17 instance_url := "https://floridapolytechnic.instructure.com" 17 instance_url := os.Getenv("CANVAS_INSTANCE")
18 base_link = instance_url + "/api/v1" 18 base_link = instance_url + "/api/v1"
19 token = os.Getenv("CANVAS_API_KEY") 19 token = os.Getenv("CANVAS_API_KEY")
20 jar, _ := cookiejar.New(&cookiejar.Options{ 20 jar, _ := cookiejar.New(&cookiejar.Options{
diff --git a/main.go b/main.go
index cd110ad..c3fe1a5 100644
--- a/main.go
+++ b/main.go
@@ -24,7 +24,7 @@ func usage() {
24 fmt.Println(" -t, --timetable\tlists the class sessions in a course") 24 fmt.Println(" -t, --timetable\tlists the class sessions in a course")
25 fmt.Println(" -v, --verbose\tprints with verbose output") 25 fmt.Println(" -v, --verbose\tprints with verbose output")
26 fmt.Println(" -h, --help\tdisplays this help message") 26 fmt.Println(" -h, --help\tdisplays this help message")
27 fmt.Println(" -p, --profile\twrites cpu profile to a file") 27 fmt.Println(" -p, --profile\twrites cpu profile to a file (for debugging/optimizing)")
28} 28}
29 29
30func main() { 30func main() {