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/$%7Bsuccess?q=fetch&page=682&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 8667 results for "fetch"(1511ms)

weatherGPTmain.tsx1 match

@stevekrouse•Updated 1 year ago
4let location = "brooklyn ny";
5let lang = "en";
6const weather = await fetch(
7 `https://wttr.in/${location}?lang=${lang}&format=j1`,
8).then(r => r.json());

caloriesmain.tsx2 matches

@stevekrouse•Updated 1 year ago
6
7function esmTown(url) {
8 return fetch(url, {
9 headers: {
10 "User-Agent":
15
16const app = new Hono();
17export default app.fetch;
18
19app.get("/", async (c) =>

launch_thrifty_idea_generatormain.tsx1 match

@cotr•Updated 1 year ago
34 };
35
36 const response = await fetch(`${url}?key=${apiKey}`, {
37 method: "POST",
38 headers,

staticChessmain.tsx3 matches

@compuives•Updated 1 year ago
1/** @jsxImportSource https://esm.sh/react */
2import { modifyFetchHandler as codeOnValTown } from "https://esm.town/v/andreterron/codeOnValTown?v=45";
3import { modifyResponse } from "https://esm.town/v/andreterron/codeOnVT_modifyResponse?v=9";
4
13
14 constructor() {}
15 async fetch(req: Request): Promise<Response> {
16 const gameInfo = parseURL(req.url);
17 if (gameInfo === undefined) {
232const sc = new StaticChess();
233
234export default sc.fetch.bind(sc);

isMyWebsiteDownmain.tsx3 matches

@thejian•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=11";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4export default async () => {
8 let reason: string;
9 try {
10 const res = await fetch(URL);
11 if (res.status !== 200) {
12 reason = `(status code: ${res.status})`;
14 }
15 } catch (e) {
16 reason = `couldn't fetch: ${e}`;
17 ok = false;
18 }

staticChessmain.tsx2 matches

@wesleychiyoka•Updated 1 year ago
10
11 constructor() {}
12 async fetch(req: Request): Promise<Response> {
13 const gameInfo = parseURL(req.url);
14 if (gameInfo === undefined) {
211
212const sc = new StaticChess();
213export default sc.fetch.bind(sc);

maroonBadgermain.tsx2 matches

@masd1•Updated 1 year ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
2import { html, load } from "npm:cheerio";
3
4const htmlStr = await fetchText(
5 "https://archive.is/pPFRB",
6);

staticChessmain.tsx2 matches

@rickygrassmuck•Updated 1 year ago
10
11 constructor() {}
12 async fetch(req: Request): Promise<Response> {
13 const gameInfo = parseURL(req.url);
14 if (gameInfo === undefined) {
211
212const sc = new StaticChess();
213export default sc.fetch.bind(sc);

limit_model_forkmain.tsx2 matches

@std•Updated 1 year ago
24 const authHeader = req.headers.get("Proxy-Authorization") || req.headers.get("Authorization");
25 const token = authHeader ? parseBearerString(authHeader) : undefined;
26 const meRes = await fetch(`${API_URL}/v1/me`, { headers: { Authorization: `Bearer ${token}` } });
27 if (!meRes.ok) {
28 return new Response("Unauthorized", { status: 401 });
46 headers.set("OpenAI-Organization", Deno.env.get("OPENAI_API_ORG"));
47
48 const openAIRes = await fetch(url, {
49 method: req.method,
50 headers,

tinygoHttpExampleREADME.md1 match

@maxm•Updated 1 year ago
16
17import { wasmHandler } from "https://esm.town/v/maxm/tinygoHttp";
18const resp = await fetch("https://maxm-wasmblobhost.web.val.run/jpxqvyy5tphiwehzklmioklpkpz4gpzs.wasm");
19const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));
20export default async function(req: Request): Promise<Response> {

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago