-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New internal api #20
Comments
Look into x-ray: https://github.com/lapwinglabs/x-ray |
Bluebird for Promises: https://github.com/petkaantonov/bluebird |
Ideas for API usage, with inspiration from https://github.com/mikedeboer/node-github#example and others. // Require
var Banner = require('self-service-banner');
// Create and configure instance
var banner = Banner({
// Required
"host": "https://ssb-nlive.smu.ca",
// Optional: Required only for authenticated requests (Login)
"username": creds.username,
"password": creds.password
});
// Optional: all authenticated requests will implicitly call login before, if not already logged in
banner.login(/* optionally pass the credentials as argument to login method */)
.then(function() {
// Is logged in.
// All subsequent requests will use this authentication.
// Only a single session is stored for this banner instance,
// therefore logging in again will create a new session with Banner's server
})
.catch(function(error) {
// Could not log in. Banner occurred...
console.error(error);
});
// Unauthenticated request
// Does not request login or user credentials
banner.terms()
.then(function(terms) {
console.log(terms); // Array of terms
});
// Authenticated request
// Requires user credentials
// Will login before if not previously logged in
banner.weekAtAGlance()
.then(function(weekSchedule) {
// Courses for this week's schedule
// For the currently logged in user
}); |
Look into using a loader such that it would automatically load new files in a directory. See http://stackoverflow.com/a/5365577/2578205http://stackoverflow.com/a/5365577/2578205 |
/cc @valencik
The text was updated successfully, but these errors were encountered: