Jawbone JavaScript and Resting Heart Rate data

北城以北 提交于 2019-12-11 18:37:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!