Skip to content

Commit

Permalink
Merge branch 'yihong0618:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jujimeizuo committed Oct 7, 2023
2 parents 7c320d9 + 00a6e04 commit c7110d7
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_data_sync.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Run Data Sync

on:
workflow_dispatch:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
push:
Expand Down
30 changes: 24 additions & 6 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ R.I.P. 希望大家都能健康顺利的跑过终点,逝者安息。

## 它是怎么工作的

![image](https://user-images.githubusercontent.com/15976103/105784027-e1ad9900-5fb2-11eb-9479-372be21482f1.png)
![image](https://github.com/yihong0618/running_page/assets/15976103/85d8d59d-2639-431e-8406-9d818afbd4ab)

## 特性

Expand Down Expand Up @@ -461,13 +461,21 @@ python3(python) run_page/tulipsport_sync.py nLgy****RyahI

如果你想同步 `fit` 格式,增加命令 --fit

如果你使用 Garmin 作为数据源建议您将代码拉取到本地获取 Garmin 国际区的密钥,注意**Python 版本必须>=3.8**

#### 获取佳明国际区的密钥

在终端中输入以下命令

```python
# to get secret_string
# 获取密钥
python3(python) run_page/get_garmin_secret.py ${your email} ${your password}
# use this secret_string
python3(python) run_page/garmin_sync.py ${secret_string}
```

#### 执行佳明国际区同步脚本

复制上述终端中输出的密钥,如果您是使用 Github 请在 Github Action 中配置**GARMIN_SECRET_STRING**参数

示例:

```python
Expand All @@ -487,13 +495,23 @@ python3(python) run_page/garmin_sync.py xxxxxxxxxxx

如果你想同步 `fit` 格式,增加命令 --fit

如果你使用 Garmin 作为数据源建议您将代码拉取到本地获取 Garmin 国际区的密钥,注意**Python 版本必须>=3.10**

#### 获取佳明国区的密钥

在终端中输入以下命令

```python
# to get secret_string
python3(python) run_page/get_garmin_secret.py ${your email} ${your password} --is-cn
# use this secret_string
python3(python) run_page/garmin_sync.py ${secret_string}
```

![get_garmin_cn_secret](docs/get_garmin_cn_secret.jpg)

#### 执行佳明国区同步脚本

复制上述终端中输出的密钥,如果您是使用 Github 请在 Github Action 中配置**GARMIN_SECRET_STRING_CN** 参数
![get_garmin_secret](docs/add_garmin_secret_cn_string.jpg)
示例:

```python
Expand Down
50 changes: 42 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ English | [简体中文](https://github.com/yihong0618/running_page/blob/master/

## How it works

![image](https://user-images.githubusercontent.com/15976103/103496454-4294f600-4e79-11eb-9bd6-8eea7a07ddff.png)
![image](https://github.com/yihong0618/running_page/assets/15976103/85d8d59d-2639-431e-8406-9d818afbd4ab)

## Features

Expand Down Expand Up @@ -271,9 +271,23 @@ If you only want `tcx` files add args --tcx

If you only want `fit` files add args --fit

If you are using Garmin as a data source, it is recommended that you pull the code to your local environment to run and obtain the Garmin secret.
**The Python version must be >=3.8**

#### Get Garmin Secret

Enter the following command in the terminal

```python
# to get secret_string
python3(python) run_page/get_garmin_secret.py ${your email} ${your password}
```

#### Execute Garmin Sync Script

Copy the Secret output in the terminal,If you are using Github, please configure **GARMIN_SECRET_STRING** in Github Action.

```python
# use this secret_string
python3(python) run_page/garmin_sync.py ${secret_string}
```
Expand Down Expand Up @@ -303,17 +317,35 @@ If you only want `tcx` files add args --tcx

If you only want `fit` files add args --fit

If you are using Garmin as a data source, it is recommended that you pull the code to your local environment to run and obtain the Garmin secret.
**The Python version must be >=3.10**

#### Get Garmin CN Secret

Enter the following command in the terminal

```python
# to get secret_string
python3(python) run_page/get_garmin_secret.py ${your email} ${your password} --is-cn
# use this secret_string
python3(python) run_page/garmin_sync.py ${secret_string}
```

![get_garmin_cn_secret](docs/get_garmin_cn_secret.jpg)

#### Execute Garmin CN Sync Script

Copy the Secret output in the terminal,If you are using Github, please configure **GARMIN_SECRET_STRING_CN** in Github Action.
![get_garmin_secret](docs/add_garmin_secret_cn_string.jpg)

example:

```python
python3(python) run_page/garmin_sync.py xxxxxxxxx(secret_string)--is-cn
python3(python) run_page/garmin_sync.py xxxxxxxxx(secret_string) --is-cn
```

only-run:

```python
python3(python) run_page/garmin_sync.py xxxxxxxxxxxxxx(secret_string) --is-cn --only-run
```

</details>
Expand Down Expand Up @@ -647,12 +679,14 @@ For more display effects, see:
1. Go to repository's `Settings -> GitHub Pages -> Source`, choose `GitHub Actions`

2. Go to the repository's `Actions -> Workflows -> All Workflows`, choose `Run Data Sync` from the left panel, and click `Run workflow`.
* The `Run Data Sync` will update data and then trigger the `Publish GitHub Pages` workflow
* Make sure the workflow runs without errors.

- The `Run Data Sync` will update data and then trigger the `Publish GitHub Pages` workflow
- Make sure the workflow runs without errors.

3. Open your website to check on the results
* note if the website doesn't reflect the latest data, please refresh it by `F5`.
* Some browsers (e.g. Chrome) won't refresh if there is a cache, you then need to use `Ctrl+F5` (Windows) or `Shift+Cmd+r` (Mac) to force clearing the cache and reload the page.

- note if the website doesn't reflect the latest data, please refresh it by `F5`.
- Some browsers (e.g. Chrome) won't refresh if there is a cache, you then need to use `Ctrl+F5` (Windows) or `Shift+Cmd+r` (Mac) to force clearing the cache and reload the page.

4. make sure you have write permissions in Workflow permissions settings.

Expand Down

0 comments on commit c7110d7

Please sign in to comment.