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=533&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 8480 results for "fetch"(1565ms)

uptimemain.tsx2 matches

@sophie•Updated 6 months ago
11 const start = performance.now();
12 try {
13 const res = await fetch(url);
14 end = performance.now();
15 status = res.status;
22 } catch (e) {
23 end = performance.now();
24 reason = `couldn't fetch: ${e}`;
25 ok = false;
26 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);

rss_feed_ai_analysismain.tsx7 matches

@vip•Updated 6 months ago
36
37 useEffect(() => {
38 fetchKeys();
39 }, []);
40
41 const fetchKeys = async () => {
42 try {
43 const response = await fetch("/keys");
44 if (!response.ok) {
45 throw new Error(`HTTP error! status: ${response.status}`);
48 setKeys(data.map(item => item.key));
49 } catch (e) {
50 setError(`Failed to fetch keys: ${e.message}`);
51 }
52 };
54 const handleKeyClick = async (key: string) => {
55 try {
56 const response = await fetch(`/feed/${encodeURIComponent(key)}`);
57 if (!response.ok) {
58 throw new Error(`HTTP error! status: ${response.status}`);
66 setError(null);
67 } catch (e) {
68 setError(`Failed to fetch feed: ${e.message}`);
69 }
70 };
75 setAnalysis(null);
76 setError(null);
77 const response = await fetch("/analyze", {
78 method: "POST",
79 headers: { "Content-Type": "application/json" },

LSDisolatedCodemain.tsx1 match

@willthereader•Updated 6 months ago
2 const query = `SELECT a AS title, a@href AS url FROM ${url} GROUP BY a`;
3 try {
4 const response = await fetch(`https://lsd.so/api?query=${encodeURIComponent(query)}`);
5 const links = await response.json();
6 console.log("Expected projects/. The bug is projects/projects", links);

blob_adminmain.tsx2 matches

@vip•Updated 6 months ago
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";
137});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));

sqliteExplorerAppmain.tsx4 matches

@mixer•Updated 6 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 })));

blob_admin_oldmain.tsx2 matches

@dcm31•Updated 6 months ago
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";
137});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));

boldRoseWaspmain.tsx1 match

@parkerdavis•Updated 6 months ago
10app.get("/", async (c) => c.html(await sqlite_admin_tables()));
11app.get("/:table", async (c) => c.html(await sqlite_admin_table(c.req.param("table"))));
12export default basicAuth(app.fetch, { verifyUser: (_, password) => verifyToken(password) });

uptimemain.tsx2 matches

@bootspoon•Updated 6 months ago
11 const start = performance.now();
12 try {
13 const res = await fetch(url);
14 end = performance.now();
15 status = res.status;
22 } catch (e) {
23 end = performance.now();
24 reason = `couldn't fetch: ${e}`;
25 ok = false;
26 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);

codecommentermain.tsx1 match

@JamesAndrew•Updated 6 months ago
32 try {
33 setIsLoading(true);
34 const response = await fetch("/comment", {
35 method: "POST",
36 headers: { "Content-Type": "application/json" },

sqliteExplorerAppmain.tsx4 matches

@sammeltassen•Updated 6 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 })));

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago