1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { cleanWorkoutData } from "https://esm.town/v/andreterron/cleanWorkoutData";
import process from "node:process";
import { pelotonUserId } from "https://esm.town/v/andreterron/pelotonUserId";
import { fetchPelotonWorkouts } from "https://esm.town/v/andreterron/fetchPelotonWorkouts";
export const fetchPelotonData = async () =>
await Promise.all(
(
await fetchPelotonWorkouts(
pelotonUserId,
process.env.pelotonSessionId
)
).data
.slice(0, 14)
.map((w) => cleanWorkoutData(w))
);
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023