0.0.4 • Published 10 years ago
basis-fetch v0.0.4
#Basis-fetch
Quick module to get one days metrics from the Basis Peak private API. Using the Basis private API so it could break at any time. Tests and support for other data types coming soon.
Install
$ npm install basis-fetchAccess Token
Username and Password thay ou use on https://app.mybasis.com/
basis.requestUser(username, password, "2015-05-04");
// returns error, access tokenGet Metrics for a day
Date Format: YYYY-MM-DD
basis.getMetrics(accessToken, "2015-05-03", "details", callback)
// returns error, array of dataGet Latest Data
Finds the most recent complete data.
basis.getLatest(data, function(metric) {
console.log("time: ", moment.unix(metric.date).format("dddd, MMMM Do YYYY, h:mm:ss a"));
console.log("temp (c): ", convertTemp(metric.skinTemp));
console.log("latest metric:", metric);
}