Skip to content

go console app for syncing data to sqlite db in docker volume for blog

Notifications You must be signed in to change notification settings

code-with-brian/strava-api-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Strava API Sync

This project is a Go application that interacts with the Strava API to refresh tokens and fetch activities.

Prerequisites

  • Go 1.16 or later
  • A Strava account and API credentials
  • A .env file with your Strava API credentials

Installation

  1. Clone the repository:

    git clone https://github.com/code-with-brian/frugal-thinker-sync.git
    cd frugal-thinker-sync
  2. Install dependencies:

    go mod tidy
  3. Create a .env file in the root directory of the project and add your Strava API credentials:

    STRAVA_CLIENT_ID=your_client_id
    STRAVA_SECRET=your_client_secret
    STRAVA_REFRESH_TOKEN=your_refresh_token

Usage

Run the application:

go run main.go

The application will:

  1. Load the environment variables from the .env file.
  2. Use the Strava API credentials to refresh the access token.
  3. Fetch activities from Strava using the new access token.
  4. Print the activities in JSON format.

Dependencies github.com/code-with-brian/frugal-thinker-sync/strava github.com/joho/godotenv

About

go console app for syncing data to sqlite db in docker volume for blog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages