Giter Club home page Giter Club logo

strava-utils's Introduction

Strava Utils

Command Line Utilities for interacting with Strava.

Scripts

  • Main Script

    • maintain.py - calls functions in the fix library to (1) re-title activities; (2) correct elevation to use Strava elevation (not device) if elevation is off.
  • Other Scripts

    These can also be called standalone.

    • get_activities.py - gets activities from Strava as JSON object(s). By default, retrieves only the most five recent activities.
    • fix.py - functions to correct Strava data.
  • Libraries

    • stravaauth.py - manages auth tokens, etc.

Authorization Setup

  1. Create a Strava App from your account. You will need the client ID and client secret later.

  2. Enter the URL below (modified with your Strava client ID) to get an authorization token with the appropriate scope. The Strava API explains calls and scopes. We ask for read and write here because the scripts do write to activities (updating activity names, for example).

  • Need client ID from Strava

https://www.strava.com/oauth/authorize?scope=read,activity:read_all,activity:write,profile:read_all,read_all&client_id=[CLIENT-ID]&response_type=code&redirect_uri=http://localhost:8888/strava-call-back.php&approval_prompt=force

  1. Get an access token curl -X POST https://www.strava.com/oauth/token -F client_id=[client_id] -F client_secret=[client_secret] -F code=[CODE from URL] -F grant_type=authorization_code > conf/strava_tokens.json

Once you have the initial tokens, the scripts will use the refresh token to fetch new tokens once these expire. An alternative walkthrough is here.

strava-utils's People

Contributors

feamster avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.