GithubHelp home page GithubHelp logo

rhino0221 / activities Goto Github PK

View Code? Open in Web Editor NEW

This project forked from flopp/activities

0.0 0.0 0.0 453 KB

Your self-hosted activities overview (running, cycling, ...). Synced with Strava.

Home Page: https://activities.flopp.net

License: MIT License

Makefile 0.89% Python 24.53% HTML 23.91% JavaScript 47.22% CSS 3.45%

activities's Introduction

Activities

Any color you like Continuous Integration

Your self-hosted activities overview (running, cycling, ...). Synced with Strava.

https://activities.flopp.net

Screenshot

Features

  • Built-in http server to authenticate with Strava.
  • Fetching of Strava activities.
  • Visited POI (predefined point-of-interest) matching.
  • Filtering by activity name, activity type, min/max distance, visited POI.
  • Running streak computation.
  • Heatmaps.

Usage

Installation

git clone https://github.com/flopp/activities.git
cd activities
python3 -m venv .env
.env/bin/pip install --upgrade pip
.env/bin/pip install .

Fetch API Config from Strava (once!)

  1. Create an "Application" on https://www.strava.com/settings/api; for "Authorization Callback Domain" use localhost, for all other properties you can basically use whatever you want ;)
  2. Copy config-example.json to config.json and fill in the "Client ID" and the "Client Secret" from the "My API Application" section on https://www.strava.com/settings/api.

Authenticate with Strava (once!)

.env/bin/activities \
    --auth

Now a web browser window should open with an "Authenticate with Strava" button. If not, manually open localhost:5000 in a web browser of your choice. Click "Authenticate with Strava". Allow access for the app. The authentication data is now saved in data.db for later use.

Sync

.env/bin/activities \
    --sync \
    --browser

This fetches your Strava data, creates a static website, and opens a browser to view the website. You can also manually point a web browser of your choice to file:///INSTALLATION_PATH/web/index.html...

Visited POI Computation

If you want to know which points-of-interest (POI), e.g. peaks of mountains, you have visited on each activity, create a JSON file containing the names and lat/lon pairs of your POI, e.g.

{
    "Belchen": {"lat": 47.822496, "lon": 7.833198},
    "Feldberg": {"lat": 47.873986, "lon": 8.004683},
    "Hinterwaldkopf": {"lat": 47.918979, "lon": 8.016681},
    "Kandel": {"lat": 48.062517, "lon": 8.011391},
    "Kybfelsen": {"lat": 47.960851, "lon": 7.885071},
    "Rosskopf": {"lat": 48.010010, "lon": 7.901702},
    "Schauinsland": {"lat": 47.911940, "lon": 7.898506},
    "Schönberg": {"lat": 47.954722, "lon": 7.805504}
}

Then just add the option --poi mypoi.json to your .env/bin/activities command.

Made with

License

MIT License

Copyright (c) 2020 Florian Pigorsch

activities's People

Contributors

flopp avatar yihong0618 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.