Strava is a very popular fitness activity tracking website, used by runners and cyclists to keep track of their exercise, as well as allowing users to compare their efforts with others in various ‘segments’ that are user-defined. I’ve been using Strava for a couple of years and have found it an excellent motivational tool.
Strava have recently launched Strava Labs, which features several projects that make use of Strava’s extensive dataset. One that I have found very interesting is the Activity Playback project, which allows you to view your activity on a map, stepping through time and seeing which other Strava users were on the road at the same time as you. This allows you to potentially identify people you’ve seen out and about – I used it recently to find someone who sucked my wheel for a while without so much as a ‘hello’.
All that is required to view this is your activity URL or ID – just copy the URL from the activity page and paste it on the Activity Playback page. However, I am lazy and so have developed a bookmarklet to do this for me. Now, when viewing a Strava activity, all I have to do is click the bookmarklet and it will take me directly to the Activity Playback page! Here is the code:
javascript:(function() { var activity = location.pathname.substr(12); if (activity % 1 == 0) { window.location = 'http://labs.strava.com/flyby/viewer/#' + activity; } else { alert('This should only be used on a Strava activity page.'); } })();
This is a simple piece of code, which takes the activity ID from the URL and then adds it to the Activity Playback base URL. To use it, you need to have a bookmarks bar visible in your browser. Then, drag this link: Strava Flyby – to the bookmarks bar, which will add the bookmarklet. Then, simply click it when viewing a Strava activity and voila!
There is very limited error checking – this is only designed to be used on a Strava activity page, if used elsewhere it will either display an error or just take you to the Activity Playback homepage. I’ve created a repository on GitHub for this – I’m sure it can be improved quite a lot but it suits my needs just fine for now.