Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/gravityblast/stravatt

Create Time Trial Challenges with ruby and the Strava API
https://github.com/gravityblast/stravatt

Last synced: about 9 hours ago
JSON representation

Create Time Trial Challenges with ruby and the Strava API

Awesome Lists containing this project

README

        

# StravaTT

[![Build Status](https://travis-ci.org/pilu/stravatt.png)](https://travis-ci.org/pilu/stravatt)

Given a Strava segment, a time range, and some users, it takes the first effort of each user on the selected
segment and creates a leaderboard based on efforts moving times.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'stravatt'
```

And then execute:

$ bundle

Or install it yourself as:

$ gem install stravatt

## Usage

```ruby
require 'time'
require 'stravatt'

segment_id = SEGMENT_ID
start_time = Time.parse DATE_STRING
end_time = Time.parse DATE_STRING

tt = StravaTT.new segment_id, start_time, end_time
tt.leaderboard [
StravaTT::User.new(YOUR_INTERNAL_ID, STRAVA_USER_ACCESS_TOKEN),
StravaTT::User.new(YOUR_INTERNAL_ID, STRAVA_USER_ACCESS_TOKEN),
StravaTT::User.new(YOUR_INTERNAL_ID, STRAVA_USER_ACCESS_TOKEN)
]

=> [
{
:user_id=>1,
:effort=>
#2,
:effort=>
#