node-schedulesdirect

1.0.4 • Public • Published

SchedulesDirect Node Module

SchedulesDirect's API Node client.

Installation

npm install node-schedulesdirect

Usage

First you need to instantiate it.

const SchedulesDirect = require('node-schedulesdirect');
 
const sdClient = new SchedulesDirect({
  username: 'your_username',
  password: 'your_password'
  //token: 'YOUR TOKEN' //OR you can just pass in a VALID token (username/password not required)
});

Using the created client, call the methods you need, example:

//get status, also includes lineups on your account
sdClient
  .get('status')
  .then(response => {
    console.log('systemStatus::', response.systemStatus);
 
    //look through the lineups
    response.lineups.forEach(async lineup => {
      //get the entire lineup that consits of the channel maps and stations
      sdClient.get(`lineups/${lineup.lineup}`).then(lineupData => {
        console.log(lineup.name);
 
        //console.log('lineupData', lineupData);
        console.log('\ttotal maps', lineupData.map.length);
        console.log('\ttotal stations', lineupData.stations.length);
      });
    });
  })
  .catch(err => console.error(err));

License

See License

Release Notes

See Changelog

Readme

Keywords

Package Sidebar

Install

npm i node-schedulesdirect

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

85.2 kB

Total Files

6

Last publish

Collaborators

  • maddog986