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/image-url.jpg%20%22Image%20title%22?q=fetch&page=695&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 9258 results for "fetch"(854ms)

gardlandmain.tsx2 matches

@zarutian•Updated 10 months ago
1// @ts-check js
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5";
3// til minnis: þarf að uppfæra þetta til að nota Hano
4/*
8export const gardland = async (req, res) => {
9 const page = {};
10 page["heroimg"] = await fetchText(
11 "https://gist.githubusercontent.com/zarutian/f48745853a6ebf4819038a88e180efb0/raw/9de6ffc5b2e5814f9ed1ce46ac15de9919ce5286/gardland_data.txt",
12 );

sqliteExplorerAppmain.tsx4 matches

@yawnxyz•Updated 10 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

sqliteExplorerAppmain.tsx4 matches

@pom421•Updated 10 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

randomFavmain.tsx1 match

@karkowg•Updated 10 months ago
4 const emoji = randomEmoji();
5
6 return fetch(`https://karkowg-fav.web.val.run?emoji=${emoji}`);
7}

changesmain.tsx3 matches

@willthereader•Updated 10 months ago
6import {
7 init,
8 traced_fetch,
9 traced_handler,
10} from "https://esm.town/v/saolsen/tracing";
39 val_req_url = `${val_req_url}?v=${version}`;
40 }
41 const val_resp: Response = await traced_fetch(val_req_url);
42 const val_version = Number(val_resp.url.split("?v=")[1]);
43 const val_body: string = await val_resp.text();
166async function handler(req: Request): Promise<Response> {
167 await track("saolsen.changes", req);
168 return await app.fetch(req);
169}
170
10});
11
12export default app.fetch;
13

livestatusmain.tsx2 matches

@triozer•Updated 10 months ago
10 getChannelLink: (username: string) => `https://twitch.tv/${username}`,
11 isLive: async (username: string) => {
12 const response = await fetch(`https://twitch.tv/${username}`);
13 const sourceCode = await response.text();
14
20 getChannelLink: (username: string) => `https://youtube.com/c/${username}/live`,
21 isLive: async (username: string) => {
22 const livePageResponse = await fetch(
23 `https://www.youtube.com/c/${username}/live`,
24 );

tanHookwormmain.tsx2 matches

@ari•Updated 10 months ago
9 let reason: string;
10 try {
11 const res = await fetch(URL, { redirect: "follow" });
12 if (res.status !== 200) {
13 reason = `(status code: ${res.status})`;
15 }
16 } catch (e) {
17 reason = `couldn't fetch: ${e}`;
18 ok = false;
19 }

violetFerretmain.tsx1 match

@tempguy•Updated 10 months ago
1import { blob } from "https://esm.town/v/std/blob?v=12";
2export default async function(interval: Interval) {
3 await fetch("https://tempguy-scarletsole.web.val.run/refresh");
4 const date = new Date();
5 await blob.setJSON("turnstileCron", { ptime: date.getTime(), ntime: interval.delay + interval.lastRunAt.getTime() });

beigeMandrillmain.tsx2 matches

@iamseeley•Updated 10 months ago
33
34 try {
35 const response = await fetch(apiUrl, {
36 method: 'POST',
37 headers: {
52 const pngUrl = jsonResponse.url;
53
54 const pngResponse = await fetch(pngUrl);
55 const pngBuffer = await pngResponse.arrayBuffer();
56

proxyFetch2 file matches

@vidar•Updated 1 day ago

TAC_FetchBasic2 file matches

@A7_OMC•Updated 2 days ago