October 23, 2023
1
2
3
4
5
6
7
8
9
10
11
12
import { fetch } from "https://esm.town/v/std/fetch";
export let chessTime = (async () => {
const { secondsToHours } = await import("npm:date-fns");
const stats = await fetch("https://lichess.org/api/user/tmcw").then((r) =>
r.json()
);
return `I've spent ${
(secondsToHours(stats.playTime.total) / 24).toFixed(2)
} days playing chess.
In that time, I could have written a novel that defined my generation.`;
})();
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
October 23, 2023
Testing the first comment on Val Town