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
tiny656 authored Oct 20, 2023
2 parents 5aff3c0 + a49bd16 commit 5882929
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
1 change: 1 addition & 0 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ R.I.P. 希望大家都能健康顺利的跑过终点,逝者安息。
| [Melt](https://github.com/fpGHwd) | <https://running.autove.dev/> | Strava |
| [deepinwine](https://github.com/deepinwine) | <https://deepin.autove.dev/> | Garmin-cn |
| [Jeffggmm](https://github.com/Jeffggmm) | <https://jeffggmm.github.io/workouts_page/> | Garmin |
| [s1smart](https://github.com/s1smart) | <https://s1smart.github.io/running_page/> | Strava |

</details>

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ English | [简体中文](https://github.com/yihong0618/running_page/blob/master/
| [deepinwine](https://github.com/deepinwine) | <https://deepin.autove.dev/> | Garmin-cn |
| [Echo](https://github.com/donghao526) | <https://donghao526.github.io/running> | JoyRun |
| [Jeffggmm](https://github.com/Jeffggmm) | <https://jeffggmm.github.io/workouts_page/> | Garmin |
| [s1smart](https://github.com/s1smart) | <https://s1smart.github.io/running_page/> | Strava |

</details>

Expand Down
Binary file added output/0.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 14 additions & 14 deletions run_page/nike_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
run_map,
)
from generator import Generator

from utils import adjust_time, make_activities_file

# logging.basicConfig(level=logging.INFO)
Expand All @@ -32,19 +31,20 @@ class Nike:
def __init__(self, refresh_token):
self.client = httpx.Client()

response = self.client.post(
TOKEN_REFRESH_URL,
json={
"refresh_token": refresh_token,
"client_id": NIKE_CLIENT_ID,
"grant_type": "refresh_token",
},
timeout=60,
)
response.raise_for_status()

access_token = response.json()["access_token"]
self.client.headers.update({"Authorization": f"Bearer {access_token}"})
# response = self.client.post(
# TOKEN_REFRESH_URL,
# json={
# "refresh_token": refresh_token,
# "client_id": NIKE_CLIENT_ID,
# "grant_type": "refresh_token",
# },
# timeout=60,
# )
# response.raise_for_status()

# access_token = response.json()["access_token"]
# self.client.headers.update({"Authorization": f"Bearer {access_token}"})
self.client.headers.update({"Authorization": f"Bearer {refresh_token}"})

def get_activities_since_timestamp(self, timestamp):
return self.request("activities/after_time", timestamp)
Expand Down

0 comments on commit 5882929

Please sign in to comment.