So since I am now planning on training for the Boston marathon, I decided I wanted to take full advantage of my Nike+ iPod. It is currently practically useless in Linux since there is no iTunes available. Determined to do something about the situation, I started searching and found these two blog articles. Unfortunately they don’t talk very much about how to synchronize the iPod with the Nike website. So I did some of my own sleuthing.
It turns out that you need to use some special magic to authenticate with the Nike website. The two wget commands below illustrate exactly what you need to do:
wget
--keep-session-cookies --save-cookies=cookies --user-agent="iTunes/7.0.2
(Windows; N)"
"https://www.nike.com/nikeplus/v1/services/app/generate_pin.jhtml?login=USERNAME
&password=PASSWORD"
wget --keep-session-cookies --load-cookies=cookies
--post-file="WORKOUTFILENAME" --user-agent="iTunes/7.0.2 (Windows; N)"
"https://www.nike.com/nikeplus/v1/services/app/sync.jhtml" --header="pin: (PIN
from previous step)"
While these two functions authenticate correctly, I can’t determine the form that Nike’s website wants the data to take. There are an infinite number of possibilities and after spending several hours trying common ones, I decided all I really wanted were the basic statistics.
So what did I do? Used my Python skills and created RunLog. RunLog is a simple Python/GTK application that reads all of the running data off your iPod and displays it in a small table in reverse chronological order. This literally took me 20 minutes so it is very rough around the edges. It could be made to work in Windows but I don’t need that functionality and therefore did not implement it. Enjoy.