Impetus
A few months ago I invested in a FitBit pedometer to help me answer the questions everyone asks themselves:
- How many steps do I take per day?
- How many stairs do I climb per day?
- How many steps do I ta… wait, I already asked that one.
- How many … hang on, I can do this…
- What kind of idiot pays $100 for a pedometer?
The data acquisition thus began.
Findings
Wow, really? I mean, I knew I was sedentary, but … hunh.
The FitBit site is actually pretty wonderful if you’re sitting at a browser with a mouse and only want to deal with a specific subset of data.
What I really wanted was an automated way to look at my two-week trend on my phone.
Phone It Up in Phone Town
Step One: ACQUIRE DATA
FitBit’s API seemed daunting, and I only wanted to spend like 30 minutes getting the data I wanted. Luckily, someone has some pretty nice instructions to synchronize your FitBit data to a Google Docs spreadsheet.
After stepping through the linked post I was able to sync my data and set up a nightly update, keeping my data up-to-date.
Step Two: CREATE GRAPH
BUT HOW TO DISPLAY.
If you want a simple chart you can add one onto the Google Docs spreadsheet itself. Personally, I wanted a trend line so I could, as my back felt better, verify my step count was getting higher. Excel has a great trendline using a rolling average over a given amount of data points, but I’m far too lazy to occassionally download the Google Doc into Excel. Instead, I turned to the Google Chart API.
Note: You will need to share your spreadsheet to use it as a data source for the Google Chart API.
It turns out the JavaScript isn’t overly complex:
Step Three: OPTIMIZE
At the time of this writing, my steps are increasing at a good pace. Give me a few weeks; I’ll injure my back again and we can get back to normal.
Conclusions
By standing on the shoulders of giants I have built a monument to laziness. Look on my works, ye Active, and despair!
Aside: Incidentally, my wife has no problem doubling or tripling my daily step count. She'll often check her count at some point in the day and, with a note of surprise in her voice, say "huh! 23,000 steps!" Someday I will top her step count and immediately be arrested for running down the street shouting about how I finally beat my wife.