Giter Site home page Giter Site logo

strava's Introduction

The code in this repository is meant to make it so that it is easy to play around with writing queries against the Strava API for querying your own personal data. It is not (currently) meant to be used to actually build applications beyond playing with personal data.

Setup

Installation Pre-requisites

python3 and the python requests library must be installed. There are no additional prerequisites at this time.

Getting Started with Strava

In order to get up & running, you will first need to follow the instructions in the Getting Started Guide around creating an API Application. This does not require anything particularly fancy to do. For the website and Authorization Callback Domain, put in localhost (if you want to e.g. play with the developer playground you will need to change the callback domain; be sure to read the entire paragraph at the heading of the playground website before attempting to use it).

Once you have that set up, you will need the Client Id, Client Secret, and Refresh Token to continue. These will be stored in plaintext by these scripts in JSON files. To run a simple script which just queries the currently-authenticated athlete's profile (i.e., you), run ./get_athlete_demo.py.

This should ask you to enter the client id, secret, and refresh token (it will then save them to disk so that you do not have to reenter these). The demo will then print out the information about your profile.

If you want to access any more detailed information, you will need to give further permissions to the application to be able to read things. To this end, you may run the ./get_activities_demo.py. This demo will attempt to query a random week of activities and print them out. At first, this will fail due to insufficient permissions. When it does so, it will attempt to open a webpage in your browser. This will give you the option to give the application varying levels of access to view your data (it will overask; you may deselect some of the options and it will still be able to view activites). Once you approve it, it will redirect you to a webpage served by the application itself that should say "Success!", and then proceed with querying the activities in question.

TODOs:

The docs describe some codegen with swagger for accessing the api in a more principled manner. That does not solve the authentication piece, but may be a more convenient way to work with data than just keeping everything as JSON.

strava's People

Contributors

jkuszmaul avatar

Watchers

Lucian avatar  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.