strava

command module
v0.0.0-...-ff1f24d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2015 License: MPL-2.0 Imports: 7 Imported by: 0

README

Go Strava Client

This is a barebones and hardly complete Go client for the Strava API v3. It was written mainly as an exercise to play around with Go and therefore only supports a small set of operations and includes a subset of fields on model objects.

Authentication

The Strava API requires authentication and uses OAuth. The OAuth flow is not implemented in this API, but access can still be gained using a developer access token which can be easily obtained by any Strava user. The Strava API page has details. Don't share your access token.

Example CLI App

A sample command line app is included that can list activities or segments. Output is in CSV (though custom delimiters are supported with with --delimiter).

Building the App
go install github.com/alecholmes/strava
Get All Activities
STRAVA_ACCESS_TOKEN=your_private_token
$GOPATH/bin/strava --accessToken $STRAVA_ACCESS_TOKEN

Or, to get activities after a given id:

STRAVA_ACCESS_TOKEN=your_private_token
$GOPATH/bin/strava --accessToken $STRAVA_ACCESS_TOKEN --afterId 212147000
Get Segment Details for Activities

All segments for activities can be printed instead of activity summaries. This is done by including the --segment flag.

STRAVA_ACCESS_TOKEN=your_private_token
$GOPATH/bin/strava --accessToken $STRAVA_ACCESS_TOKEN --afterId 212147000 --segments

All times for a specific segment, and the date of the effort:

STRAVA_ACCESS_TOKEN=your_private_token

# Dump everything into all_segments to allow reuse, since fetching is relatively slow
$GOPATH/bin/strava --accessToken $STRAVA_ACCESS_TOKEN --delimiter $'\t' --segments > all_segments

grep "\tHawk Hill\t" all_segments | cut -d $'\t' -f 8,10

Bugs

  • GetActivity blows up if a ride is private

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL