问题
I am trying to pull resting heart rate data from the jawbone server via javascript/node.js. I keep getting can not read property get. This is the part of my code that causes the error. It seems I do not have the correct naming convention to receiver resting heart rate
up.heartrates.get({}, function(err, body) {
if (err) {
console.log('Error receiving Jawbone UP data');
} else {
jawboneDataheart = JSON.parse(body).data;
for (i = 0; i < jawboneDataheart.items.length; i++) {
date = jawboneDataheart.items[i].date.toString(),
year = date.slice(0,4),
month = date.slice(4,6),
day = date.slice(6,8);
jawboneDataheart.items[i].date = month + '/' + day + '/' + year;
jawboneDataheart.items[i].title = jawboneDataheart.items[i].title.replace('for ', '');
}}});
来源:https://stackoverflow.com/questions/38748142/jawbone-javascript-and-resting-heart-rate-data