Hacker News new | ask | show | jobs
by jerryjeremy 3974 days ago
I started this project as a way to dive into learning web development. I wanted to build something a little different from traditional race prediction calculators where you just enter a single time for a recent training run. Accessing all of a runner's GPS data from Strava allows me to put a rolling window on each run and find the fastest sub-segments and build predictions based on that.

This was built using Ruby on Rails and is running on Heroku. The biggest challenges for me were:

- Connecting to an API (Strava) and consuming the data

- Figuring out how to efficiently use Sidekiq (especially on a single Heroku dyno)

- Design (this is still a work-in-process)

If it's not clear, this is for Strava users only at the moment. I plan on adding additional API access when I can find them. There are also a few more prediction calculations that I would like to include as well.

3 comments

Nice work. Some suggestions from my personal experience using Strava:

* Most runs are training runs so they carry their purposes instead of full-effort race simulation therefore predications based on training runs are usually a bit off.

* Having said that, Strava supports tagging runs which are races; not sure if the API can expose the tags but it would be useful to do a past race based prediction.

* Other than race time predictions, another area of interest is to evaluate training quality. A Chrome plugin, StravistiX does some of it but I'd like to see more such as using VDOT based on Jack Daniels' running formula which have their meanings in training.

Great suggestions - thanks!

My thought on the training run piece is that you don't even have to think about which runs or races (or even subsegments of runs/races) are your fastest. Just throw everything into the funnel and out come your race predictions. I'll think about how to use the race tag, because that is available through the API.

Training quality is a big one for me, too (especially with a family). I've actually been working on something similar and much larger than just having race predictions.

How are you calculating the predictions? What do the Reigel and Cameron columns mean?

Also, it keeps refreshing the page. How long will it take to calculate a "final" prediction?

Riegel and Cameron are two methods for calculating race predictions. I have a short post about them on the blog, but a third party description offers a better explanation currently: http://www.runningforfitness.org/faq/rp

My worker ran out of memory, so sidekiq wasn't completing your predictions. I just restarted it and it looks like everything is caught up now. It normally should only refresh once and then your predictions would be ready.

This is the problem I keep having - my sidekiq worker runs out of memory and basically stops processing the queue.

Interesting. Thanks!
awesome work, would love to see runkeeper integration
Thanks for the suggestion - I just registered for an API key.