GithubHelp home page GithubHelp logo

gabornemeth / stravasharp Goto Github PK

View Code? Open in Web Editor NEW
43.0 7.0 23.0 4.28 MB

Strava client library

License: MIT License

C# 93.24% PowerShell 2.31% Shell 1.89% CSS 0.13% HTML 2.13% JavaScript 0.16% Batchfile 0.15%
xamarin portable netstandard csharp-library dotnet strava-api

stravasharp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

stravasharp's Issues

IndexOutOfRangeException when trying to download activities with zero-length LatLng

I'm getting a new error on an existing project, when I call client.Activities.GetAllActivitiesAfter(new DateTime(2021, 1, 28))

Exception has occurred: CLR/System.IndexOutOfRangeException
Exception thrown: 'System.IndexOutOfRangeException' in System.Private.CoreLib.dll: 'Index was outside the bounds of the array.'
   at StravaSharp.LatLngConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer) in C:\code\RunTheGlobe\StravaSharp\src\StravaSharp\LatLng.cs:line 54
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
...
   at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
   at RestSharp.Portable.Deserializers.JsonDeserializer.Deserialize[T](IRestResponse response)
   at RestSharp.Portable.RestResponse`1.<LoadResponse>d__5.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
...
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at StravaSharp.ActivityClient.<GetAthleteActivities>d__8.MoveNext() in C:\code\RunTheGlobe\StravaSharp\src\StravaSharp\ActivityClient.cs:line 58

Strava's API docs say the array should have 2 elements:

LatLng
A collection of float objects. A pair of latitude/longitude coordinates, represented as an array of 2 floating point numbers.

But I can see in the strava API response "start_latlng": [], "end_latlng": [], for my activities of type WeightTraining, and runs that I manually uploaded and tagged Treadmill. (posted on the strava-api group thread about it, maybe somebody knows more.

I don't see a good workaround with the existing code, but I have a small patch I'll create a PR for.

Error on client.Activities.GetAthleteActivitiesAfter

Hi,
Im using your library with no problem form several months. Thanks for That!

From some days i have been issued this problem on executing client.Activities.GetAthleteActivitiesAfter

I'm try to send you a pull request with this type included, but a 403 received, so i created this issue

Error converting value "WaterSport" to type 'StravaSharp.ActivityType'. Path '[2].type', line 1, position 2989. at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader) at RestSharp.Portable.Deserializers.JsonDeserializer.Deserialize[T](IRestResponse response) at RestSharp.Portable.RestResponse1.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RestSharp.Portable.RestResponse.d__431.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at RestSharp.Portable.RestClientBase.<Execute>d__591.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at StravaSharp.ActivityClient.d__8.MoveNext()`

Interfaced implementation?

I'm just about to rework a Strava mash-up app that I've done a few versions of, but it's time for a new one (the previous is broken in various ways). My prior experience of developing an app with Strava is that particular during the test and debug phase, it's easy to hit Strava's rate limits. For this reason, and for various other issues of testability, I can't help feeling that this app would be a better match for my needs if it had an interface-based external definition. This could then be mocked for testing and development either for producing reproducible tests or to avoid rate limits.

Is this something you have considered? Is it something that you would be interested in help with?

GetActivity doesn't return the segment info

The include_all_efforts parameter is being ignored, which means you get the activities but not the segment efforts corresponding to the activity. This is a fairly major omission!

I'm [intending to be] fixing this as part of my other issue - doing an interfaced implementation

Nuget for #PR24

The last version of nuget is 0.5.5, who doesn't have the PR 24, inluding the new sports types.

Is going to be online or nuget is not been maintain anymore?

CI test is failing - but I can't see the result

I've just made a PR. The CI checks have had some interaction with BitRise.io which has failed. Attempting to follow the link regarding the failure gives me a 404.

WTF?

(At the time of the PR I did not have a bitrise account; I do now (although I'm nervous about it's write permission to all of my github repos)

Upload activity_id is long

https://developers.strava.com/docs/reference/#api-models-Upload

Upload activity_id is long

You have it set to a int which causes exceptions on the parsing of the data

[JsonProperty("id")]
public long Id { get; }
[JsonProperty("external_id")]
public string ExternalId { get; }
[JsonProperty("activity_id", NullValueHandling = NullValueHandling.Ignore)]
public int ActivityId { get; }
[JsonProperty("status")]
public string Status { get; }
[JsonProperty("error")]
public string Error { get; }
[JsonIgnore]
public bool IsReady { get; }

Error on client.Activities.GetAthleteActivities

Same issue as:-
#3

but with these activity types.

"Error converting value "VirtualRun" to type 'StravaSharp.ActivityType'.
"Error converting value "Golf" to type 'StravaSharp.ActivityType'.
"Error converting value "Handcycle" to type 'StravaSharp.ActivityType'.
"Error converting value "Soccer" to type 'StravaSharp.ActivityType'.

All activities done between June 2019 and July 2019. So none of them are old.

So can't read 38 user's data (out of just over 16000 athletes).

Is it compatible with Xamarin Forms?

I need to display Strava routes in a Xamarin Forms app.
It doesn't use the PCL but the new .NET Standard 2.0 instead.

Is it still possible to use StravaSharp?

Callback not working

I cloned the project and I changed the ClientId and the ClientSecret.

I run the project and I log-in page strava, then the callback funtion throw an error. I attach a image of the error.
It`s a bug? or have I done something wrong?

could you help me?
thanks

errorstrava

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.