This a node module for They Work For You API (http://www.theyworkforyou.com/api); I will use twfy to mention it in the rest of this document.
I've supposed that you have installed NodeJS and npm, so
npm install theyworkforyou-api
To use this module, you must have a twfy API key, which you can get easy from its website.
Then, let's start
var twfyAPI = require('theyworkforyou-api');
var twfyClient = twfyAPI('YOUR API KEY');
var promise = twfyClient.getMPs();
promise.then(
function (data) {
console.info('Awesome, it succeeded');
console.info('There is ' + data.length + ' MPs');
},
function (err) {
console.error('Sucks, something was wrong');
console.error('Error message:' + err.message);
}
);
To launch the tests is as pretty much straightforward as install the module, so
- install the dev-dependencies
- add your API key in the file
config/api.json
launch the test:
make test
I developed this module with livescript so if you only are interested in the javascript code you have to compile it doing:
make build
Then you will have the javascript code in build
directory
- Create a more thorough tests for all the APIs
- ... Fork an add your thoughts
Just MIT, in details in LICENSE file