Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yayadrian/basis-fetch
Node module to get one days metrics from the Basis Peak private API. Could break at any time. Sorry there are no tests or support for other data types.
https://github.com/yayadrian/basis-fetch
Last synced: about 2 months ago
JSON representation
Node module to get one days metrics from the Basis Peak private API. Could break at any time. Sorry there are no tests or support for other data types.
- Host: GitHub
- URL: https://github.com/yayadrian/basis-fetch
- Owner: yayadrian
- Created: 2015-05-10T16:17:45.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-10T16:42:19.000Z (over 9 years ago)
- Last Synced: 2024-11-08T09:05:09.829Z (2 months ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
#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
```sh
$ npm install basis-fetch
```
## Access Token
Username and Password thay ou use on https://app.mybasis.com/
```javascript
basis.requestUser(username, password, "2015-05-04");
// returns error, access token
```
## Get Metrics for a day
Date Format: YYYY-MM-DD
```javascript
basis.getMetrics(accessToken, "2015-05-03", "details", callback)
// returns error, array of data
```## Get Latest Data
Finds the most recent complete data.
```javascript
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);
}```