node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »

brutime

Brutime

js-standard-style Travis Coveralls

Brutime is a Node.JS library for scraping data from Brunel University's timetabling portal.

Install

npm install --save brutime

Usage

Require brutime

var BruTime = require('brutime')

Create an instance of BruTime with your login/password.

var timetable = new BruTime({
  login: '1156145',
  password: 'my password'
})

listMyModules() - List your enrolled modules

// List Enrolled Modules 
timetable.listMyModules(function (err, myModules) {
  if (err) {
    throw err
  }
  // myModules === ['CS2001', 'CS2002', 'CS2003'] 
  console.log('My Modules: ' + myModules.join(''))
  // Prints: CS2001, CS2002, CS2003 
})

getMyModulesTimetable() - List contact hours for your enrolled modules

timetable.getMyModulesTimetable({
  period: '1-12',
  days: '1-7'
}, function (err, timetable) {
  if (err) {
    return console.error(err)
  }
  console.log(timetable)
})

Testing

export LOGIN=YOUR_STUDENT_ID
export PASSWORD=YOUR_STUDENT_PASSWORD
$ npm test

Licence

MIT