See latest version here: link
Note - I am keen for people to test the code I have written whilst I continue to develop it. I will release the source code later (when I work out how this can be done), so for now I have built an application for installation.
Thus this post will continue to change and evolve to capture document this application fully
The application looks like this:
Currently it only does one thing - connect to Strava, download all rides between to user definable dates and allow this to be exported as a Tab Separated file. "Ride Data" means the averaged/final data for a ride (description, average speed, duration etc.). (I have development version that can download the second by second GPS data but this needs more work).
So what do you need to do to use this tool?
- Create your own Strava Application
- Install this DotNet application and run it
Creating your own Strava Application
On Your Account page you will find a link to create an application. You need to enter 4 pieces of information to get an application. Here is my information (that I can change my existing application):
You need to enter an Application Name, a website (I have used this Blog as a link at the moment), a description and finally an "Authorisation Callback Domain". This is where I failed but some Googling the problem suggested that "localhost" would get you through, which it did. These settings don't support an online solution but I don't want that - I wanted to be able to connect and get my data using a PC offline tool only
With these entries you can actually create an application and you'll get the following tokens/data:
You will need the "Access Token" to use the application. You can copy and paste from the web page into the application. Don't share your token with others. The Access Token is a 40 character hexadecimal number.
Next you need to get the application. I have put it on my Google Drive and it should be shared with anyone with this link here. Extract it from the .zip file and run setup. All should be OK.
Note that this application uses the DotNet framework so this must be installed. Most Windows PCs will already have this. I am not sure the minimum version required - refining the installer and updates is on the list of things to do!
Once its started you'll need to paste in your Strava Access token in the box and then press the Start Button.
All being well after a period of time your data should appear in the application. There is currently no progress indicator - so please wait. The longer the data window and the more activities you have to download the longer it takes to get the data - as much as 30 seconds or more.
Once its complete you can then export the data.
Closing the programme should save your Strava token which will be read next time you run the application.
This is a very short introduction. More details will follow as quickly as I can update this page. Please report all issues via the comments section of this post
Detailed Narrative
Some time ago (2013) I wrote a small tool that downloaded your Strava data using Excel and the wget utility. I documented it here (link) and made it available for download.
However this was thwarted when Strava withdrew support for the API that I was using so my tool stopped working. I gave up looking for alternative solutions at the time as I could download similar data using the great Veloviewer. However this solution was a bit flaky (not sure if it was my browser or what) but it was inconsistent.
I occasionally looked at the Strava Blog and saw that support for external applications was supported but it looked complicated - for example it looked like you needed to call from a web server and use JSON - whatever that is. (see bottom of page for a summary of JSON). However intermittent and continued reading showed that there were also libraries
Language Libraries
The Strava API is implemented using RESTful HTTP JSON patterns. A number of 3rd party language specific libraries exists to wrap this functionality and make usage seemless.
Alongside this were a set of links (replicated below) of all the different libraries implemented by individuals:
- Android - https://github.com/SweetzpotAS/StravaZpot-Android
- Clojure - https://github.com/ekimber/clj-strava
- ColdFusion - https://github.com/fancybread/strava
- Erlang - https://bitbucket.org/a12n/erl-strava/
- Go Lang - https://github.com/strava/go.strava
- Haskell - https://github.com/tfausak/strive
- iOS - https://github.com/sebastienwindal/FRDStravaClient
- Java - https://github.com/dustedrob/JStrava
- Java - http://danshannon.github.io/javastravav3api/
- Java - https://github.com/tiberiu-biking/scribejava-strava (ScribeJava)
- .Net - https://github.com/inexcitus/stravadotnet
- Node - https://github.com/ajsnapshots/node-strava-v3
- Perl - https://metacpan.org/pod/WebService::Strava
- PHP - https://github.com/basvandorst/StravaPHP/
- PHP - https://github.com/iamstuartwilson/strava
- Python - https://github.com/hozn/stravalib
- Ruby - https://github.com/jaredholdcroft/strava-api-v3
- Rust - https://github.com/jwilm/strava-rs
- Scala - https://github.com/kiambogo/Scrava
There were several steps required (not necessarily in this order:
- Get Visual Studio
- Get the Stravadotnet packages
- Create a Strava Application
- Read some documentation
- Try the examples
- Understand a bit better using Visual Studio
- Get the examples to work
- Try various things
- Work on an example
- Test and trial the example
- Get a working piece of code
- Share with the world
Hi Julyan,
ReplyDeleteI would like to write some tools based on you guidelines, but I'm a bit stuck with the C# basics (I have very basic programming exerience with VBA only).
Could you please share some code from your program to see, how can I use the commands properly.
Yes I will provide some of the source code but not for a few days as my PC is out of use at the moment (21 March)
ReplyDelete