$ npm install node-tipbot-api$ git clone https://github.com/nrpatten/node-tipbot-api.git- Then meet the package dependencies:
$ cd node-tipbot-api/
$ npm install- include node-tipbot-api into your project:
vartipbot=require('node-tipbot-api');tipbot.options({'stream' : true,'cleartext' : true});By default the returned data is an object, in order to get clear text you have to add the option cleartext (streams will always return objects):
- To activate Cleartext simply add to your options:
'cleartext' : true- To activate Streaming simply add to your options:
'stream' : true- url String
- callback Function
varurl='http://api.icndb.com/jokes/random';tipbot.sendCustomRequest(url,function(data){varinfo=data;console.log(info.value.joke);});