Giter Site home page Giter Site logo

marazt / strava-upload Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 110 KB

Strava Upload is s simple library to synchronize (create, update) activities on Strava with other activities. Currently it provides synchronization with Suunto Movescount moves that are provided by MovescountBackup library.

License: MIT License

C# 100.00%
strava strava-api strava-data activity-update activity-creation backup movescount suunto suunto-movescount

strava-upload's Introduction

Strava upload

Strava Upload is s simple library to synchronize (create, update) activities on Strava with other activities. Currently it provides examples for synchronization with:

Version

  • Version 1.0.1 - 2018-04-24

Getting Started/Installing

PM> Install-Package StravaUpload -Version 1.0.1

Project Description

The solution consists of the following projects:

  • StravaUpload.Lib is the main library containing Uploader class.

  • StravaUpload.Console is just a sample that downloads Movescount data, store them on local dist and sync them with Strava.

  • StravaUpload.StravaUploadFunction Azure function that periodically downloads data from Movescount, store them in Azure Blob Storage and sync them with Strava.

  • StravaUpload.Lib.Spec TODO.

Prerequisites

  • .NET Core 2.0.
  • For more details about MovescountUpload check the project site

Configuration

StravaUpload.Lib

  • StravaAccessToken - Name of the member whose data we want to get.

StravaUpload.Console

MovescountUploader
  • MovescountAppKey - App key to be able to query Movescount API.
  • MovescountUserKey - User key to be able to query Movescount API.
  • MovescountUserEmail - User email to be able to query Movescount API.
  • MovescountMemberName - Name of the member whose data we want to get.
  • CookieValue - A cookie value that is needed to export GPX, TCX and other move files. This value can be get by the following steps:
    1. Open console in your browser to se network requests.
    2. Login into Movescount.
    3. Select a requeset to http://www.movescount.com/api/members/private/messages.
    4. Copy value of Cookie key in request header. It should start with ASP.NET ....
  • BackupDir - Directory where moves should be stored. Required for FileSystemStorage.
  • StorageConnectionString - Connection string to Azure Blob Storage. Required for CloudStorate.
  • ContainerName - Container name on Azure Blob Storage. Required for CloudStorate.
  • StravaAccessToken - Strava access token wit write rights.
GarminConnectUploader
  • Username - Garmin Conect username.
  • Password - Garmin Conect password.
  • BackupDir - Directory where moves should be stored. Required for FileSystemStorage.
  • StorageConnectionString - Connection string to Azure Blob Storage. Required for CloudStorate.
  • ContainerName - Container name on Azure Blob Storage. Required for CloudStorate.

StravaUpload.StravaUploadFunction

  • MovescountAppKey - App key to be able to query Movescount API.
  • MovescountUserKey - User key to be able to query Movescount API.
  • MovescountUserEmail - User email to be able to query Movescount API.
  • MovescountMemberName - Name of the member whose data we want to get.
  • CookieValue - A cookie value that is needed to export GPX, TCX and other move files. This value can be get by the following steps:
    1. Open console in your browser to se network requests.
    2. Login into Movescount.
    3. Select a requeset to http://www.movescount.com/api/members/private/messages.
    4. Copy value of Cookie key in request header. It should start with ASP.NET ....
  • BackupDir - Directory where moves should be stored. Required for FileSystemStorage.
  • StorageConnectionString - Connection string to Azure Blob Storage. Required for CloudStorate.
  • ContainerName - Container name on Azure Blob Storage. Required for CloudStorate.
  • StravaAccessToken - Strava access token wit write rights.
  • SendGridApiKey - API key for SendGrid mail service to be able to send status messages.
  • EmailFrom - Email from.
  • EmailTo - Email to.

StravaUpload.Lib.Uploader.cs

Uploader is the main class for activity synchronization. It downloads activities list from Strava, compare them with list of moves that should be added/updated. The first comparison is done by activity/move start/end datetime. If an acitvity is found in Strava, it is updated. If the activity is not found in Strava, fit, gpx or other activity data file is uploaded. It can happen that newly uploaded activity is already in Strava. This state is evaluated from the upload response. In this case, the activity is just updated.

Deployment

You can use this libraly to be run manually (StravaUpload.Console.Program.cs) or you can create, e.g., a Azure function (StravaUpload.StravaUploadFunction.Function.cs) or Lambda function on AWS, that can run periodically.

Contributing

Any contribution is welcomed.

Authors

  • Marek Polak - Initial work - marazt

License

© 2018 Marek Polak. This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

  • Enjoy it!
  • If you want, you can support this project too.

strava-upload's People

Contributors

marazt avatar

Stargazers

 avatar

Watchers

 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.