0.0
No release in over 3 years
Low commit activity in last 3 years
Ruby gem for Smashrun api
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 2.1.0
~> 3.12

Runtime

~> 1.4.0
~> 3.10.2
 Project Readme

smashrun

Ruby gem for Smashrun api

Register your application for getting client id and secret: https://api.smashrun.com/register

Usage

Authentication

Smashrun.configure do |config|
  config.client_id = 'your app client id'
  config.client_secret = 'your app client secret'
end

client = Smashrun::Client.new(user_access_token)

Refresh user's access token

Smashrun tokens are valid for 12 weeks, you can refresh access tokens using user's refresh token.

client.refresh_token(refresh_token)

You better save new access token and refresh token.

Fetching activities

client.activities # => list of recent activities

You can also use fromDateUTC, page or count for filtering and paginating activities list

client.activities page: 1, count: 100

client.activities fromDateUTC: 2.days.ago.to_i, page: 2

If you want to minimize download size or need to quickly check for new activities, use following api methods instead.

client.latest_activities_briefs # retrive activities with minimal info( id, startTime, distance and duration)

client.latest_activities_ids    # or just ids

Fetching single activity detail

client.activity_detail activity_id        # full activity detail 
client.activity_svg_polyline activity_id  # retrive SVG polyline for route of activity
client.activity_geojson activity_id       # retrive activity route in GeoJSON format
client.activity_splits activity_id, 'distance_unit'        # retrive splits of an activity in specified unit ( mi for mile and km for kilometer)

Fetching user detail

client.athlete

Posting new activities

Pending...

Copyright

Copyright (c) 20117 Naveed Ahmad. See LICENSE.txt for further details.