README
Brutime
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'
})
- List your enrolled modules listMyModules()
// 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
})
- List contact hours for your enrolled modules getMyModulesTimetable()
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