8000 GitHub - SoNiceElijah/node-unn-portal
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

SoNiceElijah/node-unn-portal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0