1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import codeOnValTown from "https://esm.town/v/andreterron/codeOnValTown?v=46";
import { api } from "https://esm.town/v/pomdtr/api";
import { gfm } from "https://esm.town/v/pomdtr/gfm";
import { html } from "https://esm.town/v/stevekrouse/html?v=5";
async function handler(req: Request) {
const { data: vals } = await api(`/v1/search/vals?query=${encodeURIComponent("- [ ]")}`);
let markdown = "# Todos\n";
for (const val of vals) {
if (val.name.startsWith("untitled_")) {
continue;
}
const { readme } = await api<{ readme: string }>(`/v1/vals/${val.id}`);
if (!readme) {
continue;
}
const rows = readme.split("\n");
const todos = rows.filter(row => row.trim().startsWith("- [ ]"));
const link = `https://val.town/v/${val.author.username}/${val.name}`;
markdown = `${markdown}\n## [${val.author.username}/${val.name}](${link})\n${todos.join("\n")}`;
}
return html(await gfm(markdown));
}
export default codeOnValTown(handler);
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
v17
February 29, 2024
This may be the best val ever created
Similar vibes from HN today: https://aboutideasnow.com/