strava | JavaScript wrapper for the Strava JSON API | REST library
kandi X-RAY | strava Summary
kandi X-RAY | strava Summary
This library is a fully typed JavaScript wrapper of the Strava JSON API.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of strava
strava Key Features
strava Examples and Code Snippets
Community Discussions
Trending Discussions on strava
QUESTION
Trying to get the access token from my first axios call and place it into the 2nd. My component is like so.
When i log accessToken
to the console its an empty array. When i console.log(response.data)
I can see the response and my access_token
ANSWER
Answered 2021-Jun-11 at 14:45The problem here is you're keeping the token in the state, and once you update the state in the middle of the function, the value is not updated synchronously, thus you're still getting an empty array. I would rephrase your useEffect
with an async/await
syntax like so:
QUESTION
I'm recording workouts with a Flutter based mobile application. I can successfully upload bike workouts. https://github.com/BirdyF/strava_flutter/blob/master/lib/Models/activity.dart#L916 lists a pretty wide variety of sports. However I already noticed that "VirtualRide" reverts to a regular bike ride once it is uploaded to Strava.
Now as I'm uploading Kayaking data it also shows up as a bike ride as well (in the middle of a small lake). But at least it has the speed and the rpm (which is actually strokes per minute for kayaking). However if I switch that activity over to Kayaking on Strava's UI Strava stops showing the pace (speed) and the rpm.
I peeked at https://github.com/sanderroosendaal/rowingdata/blob/master/rowingdata/writetcx.py and that seems to output the rowing activities as "Other" sport. Its tests contain such TCXs as well. I just cannot believe TCX would be so limited. Does anyone have a pointer for me to solve this?
I'm outputting TCX because it's a textual format so it's easier to interpolate and debug than a binary FIT format. Since I can gzip it for upload its size is OK as well when compressed.
...ANSWER
Answered 2021-May-04 at 21:19It seems that TCX is too limited file format with respect to sport selection. I develop FIT file based upload and that is able to carry Kayaking and many more sports.
QUESTION
Is there a way to detect a user pausing a run/activity within the strava API?
...ANSWER
Answered 2021-Apr-19 at 14:32With Get Activity Streams (getActivityStreams
) you can obtain differents StreamSet
from your activity: in order to detect pause I think you can analyze CadenceStream
or MovingStream
.
QUESTION
I feel like this question has been answered before, but I'm off track somehow. I have the URL of a tile (see below): I see that the zoom level is 6, the 33th tile towards the east and 20th tile towards the south. My question is, can I deduct the lat/long (web mercator) coordinates of this tile using said numbers (33 / 20)?
https://heatmap-external-c.strava.com/tiles/all/hot/6/33/20@2x.png?v=19
...ANSWER
Answered 2021-Mar-29 at 05:41As stated in the tags of the question, the linked map is rendered via mapbox GL. In the mapbox docs, I found a reference to the OSM Slippy Map Tilenames specification which in turn provides the method with which to transform tilenames to lat long coordinates and vice versa. The following pseudocode answers the question.
Tile numbers (xtile
, ytile
) to lon./lat for a given zoom level (zoom
)
QUESTION
I created an app on Strava. Authorized my app on my account with read,activity:read,activity:read_all,read_all
permissions.
I didn't want polling their API for activities as they recommend webhooks for that.
So I created a webhook subscription and validated it via the callback url.
Here's the response of Strava API for the webhook subscriptions I successfully created:
...ANSWER
Answered 2021-Mar-23 at 18:56Finally solved my problem and writing the solution here for other people.
Probably the people who don't have this problem are using libraries for Strava in their coding languages which already obtain access_token
and refresh_token
after the authorization.
If you're dealing with Strava Webhook API yourself like me, after the authorization, you must obtain your access_token
and refresh_token
as explained here https://developers.strava.com/docs/getting-started/#oauth
Strava Webhook API documentation doesn't say anything about this because access_token
is not needed for creating a webhook subscription.
Strava API creates a subscription and returns a successful response. This is misleading because your endpoint won't get any webhook events
QUESTION
I am trying to show multiple sets of different polylines (each set represents one cycling route with its own start and endpoint).
There are ten routes in total I am bringing in from a JSON
file. The problem is the map
is consolidating all the individual ten routes into one mammoth polyline.
So It is sort of connecting them all together (you can just make out the very straight line connecting between each route and only one startCap
and endCap
icon).
I would expect/want to see ten different startCap
and endCap
icons and spaces between each polyline set.
So how do I make the map
show each polyline route as distinct routes?
I am using flutter_polyline_points
to decode the polyline route to the google map
.
Code below and the JSON
is on the live link to make it easy to emulate if that helps.
In essence in terms of steps :
I create the google map and have one main central marker on it.
I then bring in ten routes from a
JSON
file. These are ten objects in an array called Segments. Each object has a unique id I use for thePolyLineid
and a unique polyline set of points in a string. So I bring in theJSON
and then.iterate over each object and decode the polyline string to polyline coordinates which I attempt to then add to the map as multiple PolyLines.
Also to here is the output I am seeing to bring the issue to life.
...ANSWER
Answered 2021-Feb-16 at 11:55You have to create a list of object which contains lat long. Add polylines coordinates and markers into the list. As showing in the link.
QUESTION
My data is STRAVA activities in a dataframe with the index set as the date of the activity. I want to insert rows that are indexed with the date that is missing i.e. my dataframe would be indexed at a frequency of days from oldest to newest in the original data. I have tried the following methods from two other posts here Add missing dates to pandas dataframe and here pandas fill missing dates in time series
However the issue I run into is as follows. Because on some dates two activities occur the index label for the row no longer is unique and is duplicated.
...ANSWER
Answered 2021-Feb-09 at 17:58You could make your date
series into a dataframe and to a left merge.
QUESTION
I am trying to set up Strava authentication (which is plain oAuth2) in Asp.Net Core Blazor App. I am rather new to Blazor & Web dev (more of a backend background), and I don't seem to find out how to troubleshoot the reason why the Authentication does not work.
When I click the oAuth login button on the Login page in the (default) Blazor Server App, I get redirected to the correct oAuth login screen (of Strava in my case), but after I successfully enter the credentials for that App, the login page shows an error Error loading external login information.
While I would obviously appreciate any help or tips that could point out what is wrong in my code, I'm mostly searching for a way to get better error information and troubleshooting capabilities here. Setting a breakpoint in the EventHandler delegates does not show much.
This is the Startup.cs
extract where I have configured the authentication setup :
ANSWER
Answered 2021-Jan-22 at 10:10An update that made things work for me, so maybe it can help other people.
I performed the following actions, in order to gain more control on the entire authentication process.
- I scaffolded two pages, in which I then could debug & step through (and obviously also update and change things). More information was found in this post:
- Account.Login, which enables the customization of the actual login page
dotnet aspnet-codegenerator identity -dc CotacolApp.Data.ApplicationDbContext --files "Account.Login"
- Account.ExternalLogin, which enables the customization of the actual strava page
dotnet aspnet-codegenerator identity -dc CotacolApp.Data.ApplicationDbContext --files "Account.ExternalLogin"
- Account.Login, which enables the customization of the actual login page
- I then found out that the
var info = await _signInManager.GetExternalLoginInfoAsync();
always resulted in anull
value. And that was because I had to set the IdentityScheme to external. ``` - And after that, I had to run some custom logic to do the claim mapping. Most of those details were written down in this stackoverflow post by @Morgeh.
Hope this can help people in the future.
QUESTION
I am pretty confident I'm missing something simple here. Apologies in advance, I'm new to Android.
So far my app sends a request to the Strava OAuth server, which returns to my app's implicit deep link via the callback URI I used in the request. I'm trying to get the 'code' and the 'scope' arguments that are passed with the callback URI passed to the fragment. The argument received is this, found via getArguments.
...ANSWER
Answered 2021-Jan-17 at 20:15What I was missing was that the Bundle had a full Intent object inside of it. I had to query the Intent from the fragment's Activity with the code below:
QUESTION
I'm trying to get an implicit deep link working in a very basic Android app. The goal is to demonstrate a basic OAuth flow with Strava's OAuth server to get access to their API.
Strava automatically whitelists 'localhost' plus any authorization callback domain you enter when you register your 'app'. I'm relying on localhost.
I have an activity plus some fragments. In Android Studio I've added a deep link to a fragment that isn't the initial one. My initial fragment asks for a login name and password then creates an IntentUri to hit the Strava OAuth server. This goes just fine and it passes the callback URI in the OAuth request along with the grant requests. The problem is that the callback URI does not go to the deep link.
I've tried a few combinations for callback URIs:
- http://localhost/fibonacci/itemFragment
- localhost/fibonacci/itemFragment
- myapp://localhost/fibonacci/itemFragment
None of these work (yes I always update the URI in the OAuth request and in xml that describes the deep link at the same time.
- the callback URI triggers a request to open the browser.
- the Strava site flags the callback uri as invalid.
- the callback doesn't seem to occur.
I've also tried to test this by creating a shortcut but in each the browser tries to open the shortcut.
Below are my android manifest file, my shortcuts.xml file and my nav_graph.xml.
I should at least be able to get the shortcut to work even if Strava wouldn't work for whatever reason.
Any help is appreciated.
-------------------AndroidManifest.xml---------------------------------
...ANSWER
Answered 2021-Jan-11 at 02:15You haven't registered your in your navigation graph in your manifest, so it will never be triggered by the Android OS.
As per the implicit deep link documentation:
To enable implicit deep linking, you must also make additions to your app's manifest.xml file. Add a single
element to an activity that points to an existing navigation graph, as shown in the following example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install strava
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page