Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gravityblast/mini-strava

A ruby client and CLI for the Strava API
https://github.com/gravityblast/mini-strava

Last synced: about 9 hours ago
JSON representation

A ruby client and CLI for the Strava API

Awesome Lists containing this project

README

        

# MiniStrava

A simple Ruby client and CLI for the Strava API.

## Installation

Add this line to your application's Gemfile:

gem 'mini_strava'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mini_strava

## Usage

> client = MiniStrava::Client.new 'XYZ'
=> #

> a = client.athlete
> a.firstname
=> "Andrea"

> a.bikes.first.name
=> 'Giant TCR'

> activities = client.activities
> activities.first.average_speed
=> 6.347

> act = client.activity activities[0].id
> act.name
=> 'Evening ride'
> act.distance
=> 24727.3

Check the Strava API documentation to know more about the available fields for each resource.

### CLI

An executable called `mini-strava` will be installed with the gem. To use it, set the `STRAVA_ACCESS_TOKEN` env variable:

export STRAVA_ACCESS_TOKEN="xyz"

and then use the CLI:

$ mini-strava
MiniStrava CLI > athlete.firstname
=> "Andrea"
MiniStrava CLI > activities.first.name
=> "Evening Ride"

## Contributing

1. Fork it ( http://github.com//mini_strava/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request