extend to get streams api#7
Open
go8ose wants to merge 6 commits into
Open
Conversation
This will allow mixing in v2 api calls in later commits.
When running pychecker on the module it complains that it's not found. Even if I modified the module to always import urllib, pychecker still complained that urllib.request and urllib.error were not module attributes. I suspect the code paths that use urllib for requests do not work, hence I've removed them with this commit.
This will (in a later commit) be used to implement logins. It's a little ironic that with my last commit having removed urllib usage, I'm now re-importing it to get the urlencode() function.
Some of the strava API calls return multiple pieces of useful data, such as the /v2/authentication/login call. Rather than discard that data having the key optional means you can have the load() method return it all to your method.
Occasionally the API requires us to pass parameters in as query arguments. So far that's been done by creating the 'url' outside the load() method. But it's quite easy to do within the load() method. This also fixes a minor bug in the url forming of Athlete.rides().
…ion. This lets us get an authentication token that we can use to access the streams part of the API, and get some interesting and useful ride data.
Owner
|
The urllib/urllib2 is for Python 3 compatibility. Will look at the rest. |
Owner
|
Actually, I'm going to hold off on this for the moment. Strava just announced yesterday they're killing the v1 and v2 API entirely on May 31. http://engineering.strava.com/strava-api-update/ I've requested access to the new v3 API so I can keep strava.py alive, but we'll see. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This series of commits ends with the ability to fetch the 'streams' for a ride from Strava, which I wanted. Please consider merging these commits in. I've tried to not make any changes that break backwards compatibility (though I can't guarantee I've succeeded).