Added Uonet Status utility
This commit is contained in:
parent
81411cdb1a
commit
43b090b342
1 changed files with 27 additions and 0 deletions
27
utils/uonetStatus.js
Normal file
27
utils/uonetStatus.js
Normal 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");
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue