simple Strava to CSV ride decoder with Perl
Slight detour from my project... Just wanted confidence I could decode JSON data, at least in Perl. I wrote a little decode for Strava ride data using Perl. The code, which I call "Strava_to_csv", requires a command line option specified as follows: Strava_to_csv -activity activity-number where activity-number is the number of the activity. It's nothing fancy, and not very robust. It expects all data to be scalar except for "latlng", which is an array of two numbers, the first the latitude, the second the longitude. It worked for me. This code uses the JSON module version 2.53 from CPAN. There's a lot of stuff there about encoding type, but since Strava is unicode, it worked simply. The code is written for Linux and maybe OS/X: it uses a system call to the "wget" command to download the URL (a Perl package for HTML could be used instead). Anyway, here's my code. This hardly took any effort at all, maybe 30 minutes, which makes m...