summaryrefslogtreecommitdiff
path: root/includes/external
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-04-20 16:20:07 +0200
committerRaindropsSys <contact@minteck.org>2023-04-20 16:20:07 +0200
commitb4bcb0912c5fe1c7f00c7ac76e5b67620781d3cc (patch)
tree027238ccdf43719ae4bbb65eedeaf9823fff6471 /includes/external
parentb484fc41a94e18f679f2494d598ac3d0ae72e3f8 (diff)
downloadpluralconnect-b4bcb0912c5fe1c7f00c7ac76e5b67620781d3cc.tar.gz
pluralconnect-b4bcb0912c5fe1c7f00c7ac76e5b67620781d3cc.tar.bz2
pluralconnect-b4bcb0912c5fe1c7f00c7ac76e5b67620781d3cc.zip
Updated 12 files and added 3 files (automated)
Diffstat (limited to 'includes/external')
-rw-r--r--includes/external/school/index.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/includes/external/school/index.js b/includes/external/school/index.js
index 58947ec..00f3435 100644
--- a/includes/external/school/index.js
+++ b/includes/external/school/index.js
@@ -6,6 +6,11 @@ const url = config.pronote.url;
const username = config.pronote.user;
const password = config.pronote.password;
+process.on('unhandledRejection', (e) => {
+ console.error(e);
+ process.exit(2);
+})
+
async function getTimetable(offset, last) {
const timetable = lessons;
@@ -129,8 +134,12 @@ async function display(offset) {
}
(async () => {
+ console.log("Logging in...");
+ console.log("URL is", url + ", username is", username + ", password is", password);
global.session = await pronote.login(url, username, password);
+ console.log("Gathering timetable...");
global.lessons = await session.timetable(new Date(new Date() - (86400000 * 3)), new Date(new Date().getTime() + (86400000 * 7)));
+ console.log("Processing...");
await updateSleepTime(0);
await display(-2);