GithubHelp home page GithubHelp logo

node-uwaterloo-api's Introduction

Build Status

Installation

npm install uwaterloo-api

Usage

First, obtain a key from http://api.uwaterloo.ca to use the API

//Require the module 
var uwaterlooApi = require('uwaterloo-api'); 

//Instantiate the client 
var uwclient = new uwaterlooApi({
  API_KEY : 'YOUR_KEY_HERE'
});

//Use the API 
uwclient.get('/foodservices/menu', function(err, res) {
  console.log(res); 
}); 

uwclient.get('/events/holidays', function(err, res) {
  console.log(res); 
}); 

A list of all available endpoints can be found here.

Passing parameters

In order to pass query parameters, you can either put them directly in the path provided

uwclient.get('/courses/CS/247/schedule', {}, function(err, res){
  console.log(res);
});

Or, if you prefer, add them as dynamic parameters

uwclient.get('/courses/{course_sbuject}/{course_number}/schedule', {
   course_subject : 'CS', 
    course_number : 247
  }, function(err, res) {
    console.log(res);
});

Any additional parameters provided are automatically added to the QueryString.

Testing

Running the tests requires an API_KEY as mentioned above. Once a key is obtained, set the following variable :

# In ~/.bash_profile
export uwApiToken=SOME_TOKEN

and run

npm install
npm test 

Contributing

  1. Fork the repo
  2. Create a feature branch
  3. Add test cases if necessary
  4. Push your changes and create a PR

License

MIT

node-uwaterloo-api's People

Contributors

sanchitgera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

hl2055

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.