NodeJS axios-based unn portal SDK
$ npm i node-unn-portal -S
const portal = require('node-unn-portal')
portal.search.byGroup("382003-2")
.then((data) => {
console.log(data);
})
.catch((err) => {
console.log(err);
});
Request base url can be specified.
const { base } = require('node-unn-portal');
base(url);
// Do portal things....
Gets objects from human readable names.
const { search } = require('node-unn-portal');
Methods:
byStudent(name:string)
byGroup(name:string)
byLecturer(name:string)
byAuditorium(name:string)
Gets schedule from inner portal IDs.
const { schedule } = require('node-unn-portal');
Methods:
byStudent(id:number|string)
byGroup(id:number|string)
byLecturer(id:number|string)
byAuditorium(id:number|string)
Gets timetable from inner portal IDs.
const { timetable } = require('node-unn-portal');
// Methods like in schedule
const {
byStudent,
byGroup,
byLecturer,
byAuditorium
} = timetable;
Methods:
today()
tommorow()
weekAligned()
week()
week2Aligned()
week2()
when()
where()
Example:
const response = await portal.timetable.byGroup(portal_group_id).today();
Aligned methods get current week. Not aligned methods get 7 days from today
MIT.