Let’s scrape data from our fitness trackers!
Fitbit One
Here’s a code sample which reads data from Fitbit.
It uses the terrific Temboo library for interfacing with the Fitbit API:
https://github.com/golanlevin/IACD2014/blob/master/processingFitbit1.pde
To use it, you will need both a Fitbit account and a Temboo account.
Furthermore, in order to fetch your Fitbit data with this code, you will need to first use the Fitbit App registration and Temboo OAuth Wizard beforehand to obtain: your Fitbit accessToken, accessTokenSecret, consumerSecret, and consumerKey.
Nike Fuelband
To get data from the Nike Fuelband, you can use this code:
https://github.com/golanlevin/IACD2014/blob/master/FuelDataScraper.pde
However, in order for that code to work, you will need to obtain your Fuelband’s deviceID and accessToken. Instructions for doing so are adapted from this link. Basically, you will need to use Charles, an HTTP proxy & packet sniffer, in order to obtain those keys: http://www.charlesproxy.com/download/. Here’s the summary for doing so:
Once you have scraped the Fuelband data, you can parse it with this parser:
https://github.com/golanlevin/IACD2014/blob/master/FuelDataParser.pde