2import { updateValByName } from "https://esm.town/v/nbbaier/updateValByName?v=14";
3import { basicAuth } from "https://esm.town/v/pomdtr/basicAuth?v=62";
4import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
5import { chat } from "https://esm.town/v/stevekrouse/openai";
6import cronstrue from "npm:cronstrue";
19It stores each line of the poem in sqlite.
20It has a textbox that lets anyone input a new line to the poem.`,
21 content: await fetchText("https://esm.town/v/stevekrouse/poembuilder3?v=4"),
22 },
23 {
24 user: "an app that uses chatgpt to convert natural language to cron syntax",
25 content: await fetchText("https://esm.town/v/stevekrouse/cron2"),
26 },
27];
29const app = new Hono();
30
31export default basicAuth(app.fetch);
32app.get("/", async (c) => {
33 const example = examples[Math.floor(Math.random() * examples.length)];
98 Write ONLY Deno TypeScript.
99
100 If you use Hono, use \`export default app.fetch;\` to start the server.
101
102 Only use web standard fetch.
103 // Our library for SQLite
104 import { sqlite } from "https://esm.town/v/std/sqlite";
14 await blob.setJSON(genKey(key), url);
15 }
16 return new Response((await fetch(url)).body, { headers: { "content-type": "image/jpg" } });
17}
8 input: string,
9): Promise<{ url: string }> {
10 let resp = await fetch("https://isidentical-falimagehandler.web.val.run/", {
11 method: "POST",
12 body: JSON.stringify({ prompt: input }),
2import { blob } from "https://esm.town/v/std/blob";
3
4// Fetch user by username
5export async function getUserByUsername(username: string) {
6 const userResult = await sqlite.execute({
20 return c.html(<EditProfilePage user={user} />);
21 } catch (error) {
22 console.error("Error fetching user:", error);
23 return c.html(
24 <RootLayout>
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
133});
134
135export default modifyFetchHandler(passwordAuth(app.fetch));
93});
94
95export default app.fetch;
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export interface ValResponse {
30
31export function createVal({ token, ...data }: { token?: string } & CreateValArgs): Promise<ValResponse> {
32 return fetchJSON("https://api.val.town/v1/vals", {
33 bearer: token || Deno.env.get("valtown"),
34 method: "PUT",
23 const onData = onSubmit ? onSubmit(e) : () => 1;
24 const formData = new FormData(e.target as any);
25 const resp = await fetch("/", {
26 method: props.action ?? "POST",
27 body: formData,
10
11 constructor() {}
12 async fetch(req: Request): Promise<Response> {
13 if (new URL(req.url).pathname === "/robots.txt") {
14 return new Response("User-agent: Amazonbot\nDisallow: /\n\nUser-agent: *\nAllow: /");
231const sc = new StaticChess();
232
233export default sc.fetch.bind(sc);