- Notifications
You must be signed in to change notification settings - Fork11
History for a runner
naosense/miles
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
As the filmForrest Gump said
run, Forrest, run...
As an English proverb said, "many a little makes a mickle ", we Chinese say "不积跬步,无以至千里", it means if you don't accumulate steps, you can't go a thousand miles.
As a runner, If you run one kilometer a day, it looks inconspicuous, but if you stick to it for one year, you can run 365 kilometers, and if you stick to ten years, it will be 3650 kilometers…, not to mention that you will run faster and faster, more and more. So I wrote this software to motivate myself, it's the distance history for a runner.
- fork the repo
- replace personal information with yours
- update your running data
by http
curl -H"Content-Type:application/json" -X POST -d'{"inputs": {"dt":"2023-08-06 12:00:01", "distance":"3.02"}, "ref":"master"}' https://api.github.com/repos/{your username}/miles/actions/workflows/{your http workflow id}/dispatches -H"Authorization: token {your token}"
how to get your http workflow id?
curl https://api.github.com/repos/{your username}/miles/actions/workflows -H"Authorization: token {your token}"
by update running.csv
- link your running svg everywhere ^_^.
(Optional) config a syncer
garmin
1.1 edit garmin.py, replace token and workflow id
1.2 add crontab job, for example
31 2 * * * /usr/bin/env bash -c 'cd /home/user/bin/syncer && source /home/user/bin/syncer/venv/bin/activate && python garmin.py user password --is-cn --only-run'
running_page
2.1 add crontab job, for example
31 2 * * * /usr/bin/env bash -c 'cd /home/user/bin/syncer && source /home/user/bin/syncer/venv/bin/activate && python running_page.py <your github running_page repo, like yihong0618/running_page>
This software is inspired byiBeats andstar-history, thank you two for creating such a great software.
About
History for a runner