RideWithGPS 2.0.2
See the version list below for details.
dotnet add package RideWithGPS --version 2.0.2
NuGet\Install-Package RideWithGPS -Version 2.0.2
<PackageReference Include="RideWithGPS" Version="2.0.2" />
paket add RideWithGPS --version 2.0.2
#r "nuget: RideWithGPS, 2.0.2"
// Install RideWithGPS as a Cake Addin #addin nuget:?package=RideWithGPS&version=2.0.2 // Install RideWithGPS as a Cake Tool #tool nuget:?package=RideWithGPS&version=2.0.2
RideWithGPS
This is a very simple wrapper to the RideWithGPS API. I did not encasulate all of the functionality of the API and some of the fields may not be mapped to the correct data types, but would love to get contributions from others!
This client library is published on nuget.org below,
https://www.nuget.org/packages/RideWithGPS/
Registering with RideWithGPS's API
You need to register with RideWithGPS to get a valid API key to be able to use their API. You can request an API key by going to the link below,
Sample .NET Core Console Application
First, add the RideWithGPS nuget package to your dotnet core application,
https://www.nuget.org/packages/RideWithGPS/
Below is a sample console applicaiton using the libary. Modify the user secret keys "apikey", "email" and "password" with your actual login information.
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
namespace RideWithGPS.TestClient
{
class Program
{
static async Task Main(string[] args)
{
var config = new ConfigurationBuilder()
.AddUserSecrets<Program>()
.Build();
// RideWithGPS API connection details
var connection = new RideWithGPSConnectionInfo()
{
ApiKey = config["apikey"],
Email = config["email"],
Password = config["password"].ConvertToSecureString(),
};
// connect to the RideWithGPS API and get an auth token
var client = await RideWithGPSClient.Connect(connection);
// get the current user context
var user = await client.GetCurrentUserDetails();
// get the last 10 trips for the current user context
var trips = await client.GetUserTrips(user.id, 0, 10);
// print the last 10 trips
foreach (var trip in trips)
{
Console.WriteLine($"Name: {trip.name} Date: {trip.created_at}");
}
// get the user routes and display some information about them
var routes = client.GetUserRoutes(user.id, 0, 1000).Result;
Console.WriteLine($"{routes.Count} routes found");
for (int i = 0; i < routes.Count; i++)
{
var routeDetails = client.GetRouteDetails(routes[i].id).Result;
Console.WriteLine($"[{i.ToString("D3")}] {routeDetails.name}: {routeDetails.track_points.Count} track points and {routeDetails.points_of_interest.Count} POIs");
}
// get the user events and print their name and number of routes
(await client.GetUserEvents(user.id)).ForEach(userEvent =>
{
var eventDetails = client.GetEventDetails(userEvent.Id).Result;
Console.Out.WriteLine($"Event {eventDetails.name} (Id: {eventDetails.id}) contains {eventDetails.routes.Count} route(s)");
});
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.