uni is a service that scrape the HKUST Class Schedule & Quota system and perform organisation and analysis on the data gathered.
-
Install node.js
-
Download the repo
git clone https://github.com/gafea/uni/ cd uni -
Install nodejs dependencies
npm install jsdom -
(optional) To start with some data in place, extract
course.7zonto the root folder. The folder structure should look like this:[root] | - [cdn] | | - boot.js | ... | | - [course] | | - [ACCT] | | - [AESF] | ... | | - course.7z | - uni_node.js ...The
course.7zcould be deleted after extraction. -
Start the server and navigate to
localhost:8002on your browser.node uni_node.js
There are several nodejs scripts that has its filename ending with _node.js in this repo and they serve different purposes. They could be run according to your needs by running node [filename] in the command prompt/terminal.
This is the main server script. It starts two HTTP servers listening at port 8002 and 7002. Port 8002 is designed to face the public internet and 7002 to face internal intranet only. This script also serves as a buffer to cache the course data organised by course_cache_node.js.
This script gathers the data stored in ./course/ folder and read the course data in JSON scraped and formatted by course_fetch_node.js. It organises the data across different files into variables easily readable and trimmable by uni_node.js. It then POSTs the variables to uni_node.js via the internal API (Port 7002).
This script gathers the webpages from the HKUST Class Schdule & Quota website and format the HTMLs into JSONs using JSdom.
This script gathers the webpages from the Final Examination Schedule website instead and format the HTMLs into JSONs using JSdom.
This script requires an instance of Stable Diffusion webui running on port 7860 with API mode enabled. It feeds each courses' title and description into the API and places the generated pictures into .\cdn\uni_ai\ folder, which would be used as background image of the course.