Pulls data from the fitbit website for analysis. Currently able to pull:
- steps
- distance
- floors
- active minutes (sedentary/light/fair/very)
- calories burned
- calories consumed
- resting heartrate
- weight
- daily nutrition summary
The file read.R is used for reading fitbit data from the web. Data is read using the Fitbit API and OAuth 2.0.
Authentication is performed using method found here: http://blog.numbersinlife.com/2015/09/silly-oauth2-connect-to-fitbit-api-from.html
- Authentication triggered automatically if no AccessToken has been previously stored.
- Enter OAuth 2.0 clientID from Fitbit API app manager.
- Copy the genereated URL string to browser as the address.
- Confirm the requested permissions.
- The browser will say the requested page is not available, but there will be an URL in the address field (the URL will start with http://localhost:1410/). Copy and paste the returned url somewhere.
- Find "access_token=" in it and copy the long string after the equals sign.
- Paste at the prompt.
- Token will be stored in a file in the home directory (~/.fbapi/.OAuth)
- Sleep data import
- Parsing json data
- Summarize by day