14// Generic loader that forwards on requests for that page's JSON data
15function loader({ request }) {
16 return fetch(request, {
17 headers: {
18 "Content-Type": "application/json",
24function action({ request }) {
25 if (request.method === "GET") { throw Error("GET not expected here - something is wrong."); }
26 return fetch(request);
27}
28
1export default async function(req: Request): Promise<Response> {
2 const response = await fetch("http://worldtimeapi.org/api/timezone/America/New_York")
3 const timeData = await response.json()
4
7} from "https://esm.sh/@imagemagick/magick-wasm";
8
9const resp = await fetch("https://esm.sh/@imagemagick/magick-wasm@0.0.29/dist/magick.wasm");
10const wasmBytes = await resp.arrayBuffer();
11
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText";
2
3const EMOJI_DATA_URL = "https://unicode.org/Public/emoji/15.1/emoji-zwj-sequences.txt";
4
5export async function getCompoundEmojis(): Promise<string[]> {
6 const data = await fetchText(EMOJI_DATA_URL);
7 let result: string[] = [];
8 const lines = data.split("\n");
86 const y = d3.select(this).attr("cy");
87
88 fetch(`/update?x=${x}&y=${y}&i=${d3.select(this).attr("idx")}`, { method: "post" });
89 d3.select(this).attr("stroke", null);
90 }
190 return new Response(body, { headers: { "Content-Type": "text/event-stream" } });
191});
192export default app.fetch;
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";
6
100It stores each line of the poem in sqlite.
101It has a textbox that lets anyone input a new line to the poem.`,
102 content: await fetchText("https://esm.town/v/stevekrouse/poembuilder3?v=4"),
103 },
104 {
105 user: "an app that uses chatgpt to convert natural language to cron syntax",
106 content: await fetchText("https://esm.town/v/stevekrouse/cron2"),
107 },
108];
114 content: `Convert user requests to code. Write ONLY Deno TypeScript.
115
116 If you use Hono, use \`export default app.fetch;\` to start the server.
117
118 Only use web standard fetch.
119 // Our library for SQLite
120 import { sqlite } from "https://esm.town/v/std/sqlite";
1export default async function(req: Request) {
2 const body = (await fetch("https://live.staticflickr.com/65535/53782948438_9b85e57a6c_o_d.png")).body
3 return new Response(body, {headers: {"Content-Type": "image/png"}});
4}
33
34 // Post the message so we can deal with large text data.
35 await fetch(`/post-message?threadId=${input.getAttribute("data-thread-id")}`, {
36 method: "post",
37 body: msgDiv.textContent,
147 return new Response(body, { headers: { "Content-Type": "text/event-stream" } });
148});
149export default app.fetch;
132 return new Response(body, { headers: { "Content-Type": "text/event-stream" } });
133});
134export default app.fetch;
142const app = new Hono();
143app.get("/", Time_Blindness_Loud_Calendar_via_iOS_shortcuts);
144export default app.fetch;