Fitbit is one of the most fun wearable computing devices around, and it's frequently used in Google Glass hackathons as the base for neat ideas. This repo is the older brother of another wearble technology project I maintain, WaterLogg for Android Wear. There are also several cool projects leveraging the Fitbit API, including:
Still, the one use case that wasn't working for me was having to repeatedly log intake in Fitbit's mobile and web apps gets laborious and often takes the user away from doing more important things. This is precisely the problem that Google Glass solves - decoupling you from technology and not taking you out of the moment! This simple App Engine-hosted service lets you use handsfree voice dictation to post updates everytime you hydrate, which updates your Fitbit profile.
After you've granted access to your Google and Fitbit profiles, use the "OK Glass...Post an update to...Waterlogg" command on Glass, and then speak the volume of water you've just consumed. It'll be reflected on your Fitbit dashboard.
This Glassware uses the following libraries:
- Google APIs Client Library for Python to make authorized requests using OAuth 2.0 to the Google Glass Mirror API
- Temboo's Fitbit library to manage the OAuth 1.0 flow and credentials and communicate with the Fitbit API
- A forked version of Alain Vongsouvahn's code from the Quick Start Project for Python to negotiate the Outh 2.0 dance
- Google App Engine's Task Queue to asynchronously handle notification pings from Google (in the log files, the user agent will be an HTTP-POST request from "GlassAPI")
Using the Task Queue helps greatly with scalability and performance, as the multiple API calls to remote web services can imposes a tad bit of latency, which would add-up at scale. And you don't want delays at your callback URL. Remember: DON'T LET YOUR ENDPOINT BECOME YOUR CHOKEPOINT!
Disclaimer: This was written as a personal utility and for public demonstration purposes, but I don't work for Google, Fitbit, or Temboo. I'm just a total fanboy. Due to API rate limits from Google, Fitbit, and Temboo, at the moment probably isn't ready to handle mass deployment requests. It isn't hard at all to scale it up, though, or use a different OAuth library. Go for it!
You can find out more Glassware tips in my book, Designing and Developing for Google Glass, by O'Reilly & Associates. Thanks for your support! :)