75```
76
77See the [URLPattern API](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API) for reference.
78
79## Logout
1import { api } from "https://esm.town/v/pomdtr/api";
2import { zip } from "https://esm.town/v/pomdtr/sql";
3import { sqlite } from "https://esm.town/v/std/sqlite";
9[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
12
13# TODO
1import Exa from "npm:exa-js@1.1.3";
2
3const exa = new Exa("f2e3bc4c-a68d-4dcb-abf6-a34ee090a576", "https://api-internal.exa.sh");
4
5const result = await exa.getContents(
4 try {
5 const browser = await puppeteer.connect({
6 browserWSEndpoint: `wss://connect.browserbase.com?apiKey=${Deno.env.get("BROWSERBASE_API_KEY")}`,
7 });
8
136 <meta charset="UTF-8">
137 <meta name="viewport" content="width=device-width, initial-scale=1.0">
138 <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" rel="stylesheet">
139 <title>Val Town Badge Generator</title>
140 <style>${css}</style>
7import * as qs from "https://deno.land/x/querystring@v1.0.2/mod.js";
8
9const FREESOUND_API_KEY = Deno.env.get("FREESOUND_API_KEY");
10const BASE_URL = "https://freesound.org/apiv2";
11
12interface FreeSoundResponse {
28 const queryString = qs.stringify({
29 query: query,
30 token: FREESOUND_API_KEY,
31 fields: "id,name,previews",
32 page_size: 1,
142 setIsLoading(true);
143 try {
144 const response = await fetch('/api/submit-url', {
145 method: 'POST',
146 headers: {
162 const loadUrlDatabase = async () => {
163 try {
164 const response = await fetch('/api/load-urls');
165 if (!response.ok) throw new Error('Failed to load URLs');
166 const loadedUrls = await response.json();
256
257async function server(request: Request): Promise<Response> {
258 if (request.method === 'POST' && new URL(request.url).pathname === '/api/submit-url') {
259 return handleSubmitUrl(request);
260 }
261
262 if (request.method === 'GET' && new URL(request.url).pathname === '/api/load-urls') {
263 return handleLoadUrls();
264 }
1type _Capitalize<T extends string> = T extends `${infer Letter}` ? Uppercase<Letter> : T;
2type Check = _Capitalize<"test">;
3
4type SimpleCapitalize<T extends string> = Uppercase<T>;
5type SimpleCapitalizeCheck = SimpleCapitalize<"second_test">;
1// A web audio drum machine that pulls samples from the Freesound search API.
2// A 16-step step sequencer with 4 sampled voices. Each sample is the first two
3// seconds of a Freesound search result. Tweaking the search string a little bit