Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/?q=fetch&page=277&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 3107 results for "fetch"(777ms)

dateme_routermain.tsx2 matches

@stevekrouse•Updated 10 months ago
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

fuchsiaSnipemain.tsx1 match

@tmcw•Updated 10 months ago
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

imageMagickWasmExamplemain.tsx1 match

@maxm•Updated 10 months ago
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

zwjEmojimain.tsx2 matches

@stevekrouse•Updated 10 months ago
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");

multiplayerCirclesmain.tsx2 matches

@maxm•Updated 10 months ago
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;

valwriter_react_clientsidemain.tsx5 matches

@stevekrouse•Updated 10 months ago
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";

jamesWebbImageProxymain.tsx1 match

@maxm•Updated 10 months ago
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}

valTownChatGPTmain.tsx2 matches

@maxm•Updated 10 months ago
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;

chatGPTmain.tsx1 match

@stevekrouse•Updated 10 months ago
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;

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago