Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/gravityblast/stravatt
- Owner: gravityblast
- License: mit
- Created: 2016-01-31T04:15:25.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-01T21:57:36.000Z (almost 9 years ago)
- Last Synced: 2024-04-23T23:37:29.829Z (7 months ago)
- Language: Ruby
- Size: 10.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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_STRINGtt = 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=>
#