Loading

Open Source Nike+ Activity Application

by laird, published

Open Source Nike+ Activity Application by laird Apr 7, 2013

Featured Thing!

Description

Nike+ data visualizer application, generated as a part of the MakerBot Hackathon, April 6-7, 2013.

The application reads your Nike+ exercise data and generates a Customizable Thing containing your data. You can then Customize your Thing to add your name and scale the model to the size you'd like to print. At the moment, we visualize one week of your data.

The generated Thing has STLs for printing in a single color (use the STL named 'both') and dualstrusion (merge the 'left' and 'right' STLs).

Developers are Robert Carlsen (http://www.thingiverse.com/technophobe), Sune Kaae and Laird Popkin (http://www.thingiverse.com/laird).

UPDATE: Source code is released on GitHub here: github.com/sunekaae/activity-visualizer.

Enjoy!

@laird @robertcarlsen @sunekaae

Recent Comments

view all
Sune packaged up our code and released it on GitHub at github.com/sunekaae/activity-visualizer. Feel free to add new data sources and visualizations!
Sune packaged up our code and released it on GitHub at github.com/sunekaae/activity-visualizer. Feel free to add new data sources and visualizations!
Sure, thanks for asking.

The "web app" part is written in Ruby, primarily so that it could take advantage of TBuser's Ruby client to the Thingiverse APIs, which made that part of the integration (creating a Thing, uploading a file, tagging) easy. The script accepts your Nike API token, and dates, and uses it to make queries to the Nike web services to retrieve your Nike+ activity data.

The Ruby script then pulls out the data that's relevant and formats the data and passes it into OpenSCAD. We really wanted to avoid the "copy/paste a huge string into Customizer" that we'd seem a few other apps use, so instead we came up with the following approach, which we think could be a good model for many Customizable apps.

The three of us came up with and implemented this approach, which splits the work into an external app that collects data and contains logic before OpenSCAD, and then Customizer and an OpenSCAD script which lets you tweak things and generate them as you like, and contains the layout/design logic.

1) Write the OpenSCAD script as a template with placeholders (e.g. "activity = *****activity***** ;"

2) The Ruby script takes the data and formats it as OpenSCAD arrays (e.g. "[[1, 12],[2,47],[3,0] ... ]". It turns out that some things (such as computing the sum of an array) has to be done before OpenSCAD.

3) Then the script replaces the placeholders in the template, generating an OpenSCAD script with your personal data inserted.

4) Then it creates a new Customizable Thing, appends the personalized OpenSCAD file, and makes it customizable and derived from a single 'parent' (this Thing) so that we can find them later.

5) And then we link the user to their new customizable thing.

6) In Customizer, you can enter your name, and configure how your activity data is rendered (e.g. X/Y/Z sizes, single or dual-strusion, etc.).

7) Generate your Thing to print. You can tweak settings and generate new Things. The Customizer runs the OpenSCAD script, parses out and displays parameters, shows previews, renders the STL, etc., so we got a lot for free by using Customizer.

8) As usual, download and print your Thing.

We'll be sharing the code as soon as we've got it cleaned up and documented properly.

More from Sport & Outdoors

view more

Liked By

view all

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag

Instructions

To make your own, go to thingiverse.com/apps/activity-visualizer. To access it and visualize your own Nike+ Fuel, you need to get your access token, which is done via Nike's developer site; developer.nike.com (click console tool and "get my access token"). You just use your normal Nike+ email/password - you don't need a special developer account.

Run the application at thingiverse.com/apps/activity-visualizer , and it'll retrieve your Nike+ data and use it to make a Customizable Thing for you. Then customize the thing to scale it to the size you like, generate the Thing, and print it!

Generates both single-color and dualstrusion.
Sune packaged up our code and released it on GitHub at github.com/sunekaae/activity-visualizer. Feel free to add new data sources and visualizations!
Sune packaged up our code and released it on GitHub at github.com/sunekaae/activity-visualizer. Feel free to add new data sources and visualizations!
Looks great! :)

Missed the Hackathon, but saw that some great stuff was created there: bit.ly/makerbot_hackathon. Can you explain a bit about the backend component(s) for your visualizer? What language(s) it is written in, and what dev tools/environment did you use?
Looks great! :)

Missed the Hackathon, but saw that some great stuff was created there: bit.ly/makerbot_hackathon. Can you explain a bit about the backend component(s) for your visualizer? What language(s) it is written in, and what dev tools/environment did you use?
Sure, thanks for asking.

The "web app" part is written in Ruby, primarily so that it could take advantage of TBuser's Ruby client to the Thingiverse APIs, which made that part of the integration (creating a Thing, uploading a file, tagging) easy. The script accepts your Nike API token, and dates, and uses it to make queries to the Nike web services to retrieve your Nike+ activity data.

The Ruby script then pulls out the data that's relevant and formats the data and passes it into OpenSCAD. We really wanted to avoid the "copy/paste a huge string into Customizer" that we'd seem a few other apps use, so instead we came up with the following approach, which we think could be a good model for many Customizable apps.

The three of us came up with and implemented this approach, which splits the work into an external app that collects data and contains logic before OpenSCAD, and then Customizer and an OpenSCAD script which lets you tweak things and generate them as you like, and contains the layout/design logic.

1) Write the OpenSCAD script as a template with placeholders (e.g. "activity = *****activity***** ;"

2) The Ruby script takes the data and formats it as OpenSCAD arrays (e.g. "[[1, 12],[2,47],[3,0] ... ]". It turns out that some things (such as computing the sum of an array) has to be done before OpenSCAD.

3) Then the script replaces the placeholders in the template, generating an OpenSCAD script with your personal data inserted.

4) Then it creates a new Customizable Thing, appends the personalized OpenSCAD file, and makes it customizable and derived from a single 'parent' (this Thing) so that we can find them later.

5) And then we link the user to their new customizable thing.

6) In Customizer, you can enter your name, and configure how your activity data is rendered (e.g. X/Y/Z sizes, single or dual-strusion, etc.).

7) Generate your Thing to print. You can tweak settings and generate new Things. The Customizer runs the OpenSCAD script, parses out and displays parameters, shows previews, renders the STL, etc., so we got a lot for free by using Customizer.

8) As usual, download and print your Thing.

We'll be sharing the code as soon as we've got it cleaned up and documented properly.
Thanks, we renamed it (and Sune added date params, yay!)
That's cool! But, I can't show this to my wife. Because then she'll want to do it for her fitbit. And then she'll give me hard time about not wearing my fitbit.

BTW, for something with towers like this, turning on hop seems to really help with the print quality.
I use fitbit as well. It has great APIs! Guess what I hope to do next!
Dualstrusion version looks awesome!
Top