Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stapelberg/fitbit-backup
Simple Go program to download your weight data from fitbit
https://github.com/stapelberg/fitbit-backup
Last synced: about 2 months ago
JSON representation
Simple Go program to download your weight data from fitbit
- Host: GitHub
- URL: https://github.com/stapelberg/fitbit-backup
- Owner: stapelberg
- License: other
- Created: 2014-09-03T07:46:28.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-01-07T10:25:04.000Z (12 months ago)
- Last Synced: 2024-10-31T05:51:38.247Z (about 2 months ago)
- Language: Go
- Size: 234 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fitbit-backup
fitbit-backup retrieves weight data from fitbit. So, if you have a WiFi scale
like the [Fitbit Aria](https://www.fitbit.com/de/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:
```bash
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: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
…
```