node-unn-portal

0.9.9 • Public • Published

node-unn-portal

npm Travis (.org) NPM

NodeJS axios-based unn portal SDK

Install

$ npm i node-unn-portal -S

Usage

const portal = require('node-unn-portal')

portal.search.byGroup("382003-2")
    .then((data) => {
        console.log(data);
    })
    .catch((err) => {
        console.log(err);
    });

Documentation

URL

Request base url can be specified.

const { base } = require('node-unn-portal');
base(url);
// Do portal things....

Search

Gets objects from human readable names.

const { search } = require('node-unn-portal');

Methods:

  1. byStudent(name:string)
  2. byGroup(name:string)
  3. byLecturer(name:string)
  4. byAuditorium(name:string)

Schedule

Gets schedule from inner portal IDs.

const { schedule } = require('node-unn-portal');

Methods:

  1. byStudent(id:number|string)
  2. byGroup(id:number|string)
  3. byLecturer(id:number|string)
  4. byAuditorium(id:number|string)

Timetable

Gets timetable from inner portal IDs.

const { timetable } = require('node-unn-portal');


// Methods like in schedule
const {
    byStudent,
    byGroup,
    byLecturer,
    byAuditorium
} = timetable;

Methods:

  1. today()
  2. tommorow()
  3. weekAligned()
  4. week()
  5. week2Aligned()
  6. week2()
  7. when()
  8. 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

License

MIT.

Package Sidebar

Install

npm i node-unn-portal

Weekly Downloads

3

Version

0.9.9

License

MIT

Unpacked Size

19.9 kB

Total Files

15

Last publish

Collaborators

  • soniceelijah