From 0eec8b786e7a3b1d5941851574aa8f4f91359c26 Mon Sep 17 00:00:00 2001 From: Jia Wei Lee Date: Tue, 2 Aug 2022 19:19:01 +0800 Subject: [PATCH] release: 2.0.0 (#46) * chore: bump version to 2.0.0 * docs: updated readme * style: updated readme * fix: go ref badge * style: updated readme * style: updated readme * style: updated readme * style: max image size --- FyneApp.toml | 2 +- README.md | 98 +++++++++++++++++++++---------------- internal/lominus/lominus.go | 2 +- 3 files changed, 59 insertions(+), 43 deletions(-) diff --git a/FyneApp.toml b/FyneApp.toml index 91c9d1b..b9f2e15 100644 --- a/FyneApp.toml +++ b/FyneApp.toml @@ -4,5 +4,5 @@ Website = "https://github.com/beebeeoii/lominus" Icon = "./assets/app-icon.png" Name = "Lominus" ID = "com.beebeeoii.lominus" - Version = "1.2.1" + Version = "2.0.0" Build = 199 diff --git a/README.md b/README.md index c996e74..59bac75 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,15 @@ -![GitHub Lominus version](https://img.shields.io/badge/Lominus-v1.2.1-blueviolet) -![GitHub all releases](https://img.shields.io/github/downloads/beebeeoii/lominus/total) -![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/beebeeoii/lominus) -[![Go Reference](https://pkg.go.dev/badge/github.com/beebeeoii/lominus.svg)](https://pkg.go.dev/github.com/beebeeoii/lominus) +

+ lominus-app-icon +

+ +

+ + + + + Go Reference + +

# Table of Contents @@ -24,31 +32,24 @@ # About -Lominus is a tool written in Go to automatically sync [Luminus](https://luminus.nus.edu.sg) files onto your local storage for easy access at a fixed interval of your choice. It is designed to run on Windows, macOS and Linux operating systems. +Lominus is a tool written in Go to automatically sync [Luminus](https://luminus.nus.edu.sg) and [Canvas](https://canvas.nus.edu.sg/) files onto your local storage for easy access to updated files. It runs on Windows, macOS and Linux. -**No credentials, files, or any other form of information is uploaded to any servers. Everything is stored locally on your system. Credentials are only used to authenticate with [Luminus](https://luminus.nus.edu.sg).** +**No credentials, files, or any other form of information is uploaded to any servers. Everything is stored locally on your system. Credentials are only used for authentication.** # Features -Lominus removes the hassle to download (or redownload) whenever files are uploaded (or updated), resulting in necessary manual cleanup and organisation of the files. And many more! +Lominus removes the hassle to download (or redownload) whenever files are uploaded (or updated). And many more! -- Keeps your Luminus files organised -- Automatic download of all files from Luminus Files -- Automatic update of files when files are reuploaded on Luminus +- Works with Canvas (New !) +- Keeps files updated and organised +- Automatic download of module files +- Automatic update of module files when files are reuploaded - System notifications - System-based dark/light mode -- System tray icon (Windows only) +- System tray icon - Telegram integration - - Grades notification - - Files notification - API -To be implemented: - -- Multimedia download -- Notion integration -- Custom webhook integration - # Getting Started ## Installation @@ -65,8 +66,6 @@ Your anti-virus software like Windows Defender may prompt that `lominus.exe` as This occurs because the app is unsigned amongst other reasons regarding Go executables which you may find out more [here](https://go.dev/doc/faq#virus). Signing it requires a valid certificate which is payable. -If you want to be sure (which is highly recommended), compile and build the source code manually. You may find out more under [Building](#getting-started-building) - ### macOS > Tested on M1 MacBook Air 2020 macOS Monterey Version 12.1 @@ -91,7 +90,7 @@ where `[filepath]` is the path to the `.dmg` file. ### Linux -> Tested on Ubuntu Focal 20.04.2 LTS +> Tested on Ubuntu Focal 20.04.2 LTS and Arch Download and extract the tarball @@ -107,11 +106,9 @@ sudo make install ## Building -You are highly recommended to compile and the program manually. - ### Prerequisites -1. [Go](https://go.dev/dl/) +1. [Golang](https://go.dev/dl/) 2. `gcc` @@ -161,33 +158,52 @@ import ( "github.com/beebeeoii/lominus/pkg/api" "github.com/beebeeoii/lominus/pkg/auth" + "github.com/beebeeoii/lominus/pkg/constants" ) -func main() { - credentials := auth.Credentials{ +func getLuminusModules() { + jwtToken, jwtTokenErr := auth.RetrieveJwtToken(auth.LuminusCredentials{ Username: "nusstu\\e0123456", - Password: "p455w0rd", + Password: "password", + }, false) + + if jwtTokenErr != nil { + log.Fatalln(jwtTokenErr) + } + + modulesReq, modReqErr := api.BuildModulesRequest(jwtToken, constants.Luminus) + if modReqErr != nil { + log.Fatalln(modReqErr) + } + + modules, modulesErr := modulesReq.GetModules() + if modulesErr != nil { + log.Fatalln(modulesErr) } - _, err := auth.RetrieveJwtToken(credentials, true) - if err != nil { - log.Fatalln(err) + for _, module := range modules { + log.Println(module.ModuleCode, module.Name) } +} - moduleRequest, modReqErr := api.BuildModuleRequest() +func getCanvasModules() { + canvasToken := "your-canvas-token" + + modulesReq, modReqErr := api.BuildModulesRequest(canvasToken, constants.Canvas) if modReqErr != nil { log.Fatalln(modReqErr) } - modules, modErr := moduleRequest.GetModules() - if modErr != nil { - log.Fatalln(modErr) + modules, modulesErr := modulesReq.GetModules() + if modulesErr != nil { + log.Fatalln(modulesErr) } for _, module := range modules { log.Println(module.ModuleCode, module.Name) } } + ``` ### Sample output @@ -206,19 +222,19 @@ func main() { ## Telegram -As a major messenging platform, Telegram can be used to receive notifications for things such as new grades releases. +Telegram can be used to receive notifications for things such as new grades releases. ### Setting up -1) You need to create a bot on your own via [BotFather](https://telegram.me/BotFather). Take note of the _bot token_ sent to you by **BotFather**. +1) Retrieve your _bot token_ via [BotFather](https://telegram.me/BotFather). -2) **_Important_**: Drop the bot you have just created a message to enable it to message you. +2) Retrieve your _Telegram user ID_. The simplest way is via [UserInfoBot](https://telegram.me/userinfobot). -3) You will also need to figure out your _Telegram ID_. The simplest way to get your _Telegram ID_ is via [UserInfoBot](https://telegram.me/userinfobot). +3) Copy and paste the _bot token_ and your _Telegram user ID_ in Lominus, under the Integrations tab. -4) Copy and paste the _bot token_ and your _Telegram ID_ in Lominus, under the Integrations tab. +4) Save and you should receive a test message from your bot. -5) Click save and you should receive a test message from your bot. +> Ensure that the bot is able to message you by dropping it a message. # Screenshots diff --git a/internal/lominus/lominus.go b/internal/lominus/lominus.go index d142fd2..d5d4493 100644 --- a/internal/lominus/lominus.go +++ b/internal/lominus/lominus.go @@ -3,7 +3,7 @@ package lominus const APP_NAME = "Lominus" const APP_ID = "com.lominus.beebeeoii" -const APP_VERSION = "1.2.1" +const APP_VERSION = "2.0.0" const LOCK_FILE_NAME = "lominus.lock"