Added Uonet Status utility

This commit is contained in:
Dominik Korsa 2018-12-18 20:42:46 +01:00
parent 81411cdb1a
commit 43b090b342

27
utils/uonetStatus.js Normal file
View file

@ -0,0 +1,27 @@
const getTitleAtUrl = require('get-title-at-url');
module.exports.studentNew = function() {
return new Promise((resolve, reject) => {
getTitleAtUrl("https://uonetplus-uczen.vulcan.net.pl/", function(title, error) {
if(error) {
reject(error);
return;
}
resolve(title !== "Przerwa techniczna");
});
});
}
module.exports.studentOld = function() {
return new Promise((resolve, reject) => {
getTitleAtUrl("https://uonetplus-opiekun.vulcan.net.pl/", function(title, error) {
if(error) {
reject(error);
return;
}
resolve(title !== "Przerwa techniczna");
});
});
}