Skip to content

Latest commit

 

History

History
159 lines (107 loc) · 4.95 KB

README-CN.md

File metadata and controls

159 lines (107 loc) · 4.95 KB

note1: use v2.0 need change vercel setting from Gatsby to Vite

note2: 2023.09.26 garmin need secret_string(and in Actions) get python run_page/garmin_sync.py ${secret_string} if cn python run_page/garmin_sync.py ${secret_string} --is-cn

note3: 2024.08.19: Added Elevation Gain field, If you forked the project before this update, please run the following command:

  • To resolve errors: sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: activities.elevation_gain

  • For old data: To include Elevation Gain for past activities, perform a full reimport.

  • If you don't have a local environment, set RUN_TYPE to db_updater in the .github/workflows/run_data_sync.yml file once then change back.

      python run_page/db_updater.py

screenshot

简体中文 | English

本项目基于 running_page , 添加了支持多种运动类型。部署可参考原项目操作步骤

新增特性

  1. 支持多种运动类型,如骑行、徒步、游泳
  2. 支持 APP 数据获取
    • 咕咚 (因咕咚限制单个设备原因,无法自动化)
    • 行者
  3. 支持 自驾(Google 路书) , 把自驾路线也展示在地图上

一些个性化选项

自定义运动颜色

  • 修改骑行颜色: src/utils/const.js 里的 RIDE_COLOR

新增运动类型

  • 修改 scripts/config.py, TYPE_DICT 增加类型映射关系, MAPPING_TYPE 里增加运动类型
  • 修改 src/utils/const.js, 增加类型标题,并加入到 RUN_TITLES
  • 修改 src/utils/util.js 里的 colorFromType, 增加 case 指定颜色; titleForRun 增加 case 指定类型标题
  • 参考这个 commit
  • 留言

Codoon(咕咚)

获取您的咕咚数据
python3(python) run_page/codoon_sync.py ${your mobile or email} ${your password}

示例:

python3(python) run_page/codoon_sync.py 13333xxxx xxxx

注:我增加了 Codoon 可以导出 gpx 功能, 执行如下命令,导出的 gpx 会加入到 GPX_OUT 中,方便上传到其它软件

python3(python) run_page/codoon_sync.py ${your mobile or email} ${your password} --with-gpx

示例:

python3(python) run_page/codoon_sync.py 13333xxxx xxxx --with-gpx

注:因为登录 token 有过期时间限制,我增加了 refresh_token&user_id 登陆的方式, refresh_token 及 user_id 在您登陆过程中会在控制台打印出来

image

示例:

python3(python) run_page/codoon_sync.py 54bxxxxxxx fefxxxxx-xxxx-xxxx --from-auth-token

行者

获取您的行者数据
python3(python) scripts/xingzhe_sync.py ${your mobile or email} ${your password}

示例:

python3(python) scripts/xingzhe_sync.py 13333xxxx xxxx

注:我增加了 行者 可以导出 gpx 功能, 执行如下命令,导出的 gpx 会加入到 GPX_OUT 中,方便上传到其它软件

python3(python) scripts/xingzhe_sync.py ${your mobile or email} ${your password} --with-gpx

示例:

python3(python) scripts/xingzhe_sync.py 13333xxxx xxxx --with-gpx

注:因为登录 token 有过期时间限制,我增加了 refresh_token&user_id 登陆的方式, refresh_token 及 user_id 在您登陆过程中会在控制台打印出来

image

示例:

python3(python) scripts/xingzhe_sync.py w0xxx 185000 --from-auth-token

自驾(Google 路书)

导入谷歌地图的KML路书
  1. 使用 谷歌地图 ,创建地图(路线放到同一个图层)
  2. 把图层导出为 KML 文件
  3. 把 kml 文件重命名为 import.kml, 放到 scripts目录
  4. 修改scripts/kml2polyline.py, 填入路线相关信息
# TODO modify here
# 路线名称
track.name = "2020-10 西藏 Road Trip"
# 开始/结束时间 年月日时分
track.start_time = datetime(2020, 9, 29, 10, 0)
track.end_time = datetime(2020, 10, 10, 18, 0)
# 总路程
distance = 4000  # KM
# 总天数
days = 12
# 平均每天自驾时长
hours_per_day = 6
  1. 控制台执行以下脚本
python3(python) scripts\kml2polyline.py

致谢