0.0.5 • Published 10 years ago

calnet v0.0.5

Weekly downloads
13
License
-
Repository
github
Last release
10 years ago

CalNet Authentication Client

Build Status

Login to Berkeley's CAS through the terminal.

*Login session only exists within the terminal. Using this will not establish a browser session.

Installation

1) Install with npm:

npm install calnet

2) Include module and enter CalNet credentials:

var calnet = require('calnet').configure({
  username: 'USERNAME',
  password: 'PASSWORD'
});

Usage

Let's try logging in and grabbing data from Berkeley's laundry service.

// Attempt to login
calnet.login(function(err, data) {
  if (err) return console.log(err.message);
  var laundryUrl = 'https://csweb.housing.berkeley.edu/student/laundry/room_summary_srv.php';
  // Login successful, fetch laundry data
  calnet.get(laundryUrl, function(err, data) {
    if (err) return console.log(err.message);
    console.log(data);
  });
});

Running Tests

1) Install the development dependencies:

npm install

2) Run the tests:

make test
0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago