peking
v0.0.1
Published
A simple node.js library for talking to the ducksboard API.
Downloads
2
Readme
peking
A simple node.js library for sending data to the ducksboard API.
API
pushValue(options, callback)
Sends a number or a string to a ducksboard API endpoint.
Example
var peking = require('peking');
peking.pushValue({value: 1234, api_key: 'mysecret'}, function (err) {
if (err) {
return console.error('Error Code' + err);
}
return console.log('success!');
});
pushValues(options, callback)
Pushes an array of value objects to a ducksboard API endpoint. The value objects may or may not have timestamps associated with them.
pushValueWithTimestamp(options, callback)
Sends a number or string to a ducksboard API endpoint with a timestamp.
API Options
Each API function requires an options JSON object and a callback function. The following properties in the options object are supported:
value
String or number to send to ducksboard. Required.
timestamp
Unix timestamp to send to ducksboard.
api_key
Ducksboard Push API key. Required.
host
Ducksboard push API host (default push.ducksboard.com)
port
Ducksboard push API port (default 443)
API Callback
Each peking function has a callback. If the HTTP response from ducksboard returns anything other than 200
, the HTTP status code will be set as the only parameter in the callback function.
License
Copyright (c) 2012 Flite, Inc.
Licensed under the MIT license.