GithubHelp home page GithubHelp logo

fitbit-backup's Introduction

fitbit-backup

fitbit-backup retrieves weight data from fitbit. So, if you have a WiFi scale like the Fitbit Aria, you can make a backup of the weight data that Fitbit stores for you. Of course, this tool is not restricted to just the Fitbit Aria — the data of any product which uses Fitbit to store weight data will be retrieved.

Installation

To download and compile, use:

go get -u github.com/stapelberg/fitbit-backup

Afterwards, run $GOPATH/bin/fitbit-backup to make sure it works (see below for configuration). Once you get it to spit out weight data, install a cronjob:

0 19 * * * /home/michael/gocode/bin/fitbit-backup -oauth2_cache_path=/home/michael/.fitbit-backup.token.json > ~/weight/fitbit-backup-$(date +'\%Y-\%m-\%d')

This cronjob will download weight data from Fitbit once a day and store it in a separate file. That way, even if one download fails, you will not accidentally overwrite your old backups, and you can even notice when Fitbit loses some data for whichever reason (hasn’t happened yet for me, but who knows…).

Configuration

In order to talk to fitbit, you first need to create an application. Go to https://dev.fitbit.com/apps/new and fill in the form like in this example:

fitbit app registration screenshot

Afterwards, fitbit will present you the “Client (Consumer) Secret” for the newly created application. Specify that using the flag -oauth2_client_secret.

When running fitbit-backup, it will prompt you to visit a URL in your browser in order to authorize the application to access your personal Fitbit account. Point the flag -oauth2_cache_path to a writable file and fitbit-backup will store the OAuth2 token in there. If you run fitbit-backup before the token expires, it will be automatically renewed. Ideally, you only have to visit the authorization URL in your browser once.

That’s it — now, when running fitbit-backup with all required flags, you should get an output like this:

2013-07-30 18:00 65.9
2013-07-30 23:59 65.3
…

fitbit-backup's People

Contributors

stapelberg avatar

Stargazers

 avatar Shane Peckham avatar Mark Sta Ana avatar Dmitry Seryogin avatar Eugen Neuber avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

frkout

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.