Giter Site home page Giter Site logo

fitbit-backuper's Introduction

Fitbit Backuper

Setting up

  1. Clone this repo

    git clone [email protected]:alistairjcbrown/fitbit-backuper.git
    
  2. Install dependencies

    cd fitbit-backuper
    npm install
    
  3. Set up a fitbit app

    • Go to https://dev.fitbit.com/apps/new
    • Log in with your fitbit account
    • Fill in the form (whatever details you like)
      • Defaults (personal app, read-only) don't need changed
      • For Callback URL, set to http://localhost:3000/auth/fitbit/callback
  4. Create a settings file in auth/ by copying the settings file example into place

    cp auth/settings.js.example auth/settings.js
    
  5. Enter client id and client secret from fitbit app into auth/settings.js

  6. The app should now be ready to run

Running the application

Run the app by providing the earliest date to get data from (ie. the date you started using fitbit). The app will check if data has already been pulled and, if not, will pull the data for that date.

Example:

npm run backup -- 2017-11-01

All data will be put into the data/ directory with subdirectories for year, month and day. The raw JSON for each response will be put into separate files.

Note: API calls are limited, so providing a large date range may run into problems with rejected requests. Wait until the next hour before running again.

Running for the first time

The first time you run the application, you'll need to log in. The output on the console will promp you to open a webpage where you'll be able to log into fitbit. This will provide the app with a oauth token (and refresh token) which it can use on subsequent runs. These details are saved in the auth/ directory.

Running dailing on Travis

For more details running this every day, see the nightly run section.

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.