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/$%7Bart_info.art.src%7D?q=fetch&page=97&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 8602 results for "fetch"(1650ms)

ProtoRunsApp.tsx3 matches

@wilhelm•Updated 2 weeks ago
18 const [runsResponse, setRunsResponse] = useState<RunsResponse>({ records: [] });
19
20 const fetchRuns = () => agent.com.atproto.repo
21 .listRecords({ collection: "me.wilb.test.run", repo: session.did })
22 .then(res => setRunsResponse(res.data as unknown as RunsResponse))
24 const deleteRun = (rkey: string) => agent.com.atproto.repo
25 .deleteRecord({ collection: "me.wilb.test.run", repo: session.did, rkey })
26 .then(() => fetchRuns())
27
28 return (
34 {session && <button
35 type="button"
36 onClick={fetchRuns}>
37 Get my runs
38 </button>}

FixItWandutils.ts1 match

@wolf•Updated 2 weeks ago
14 formData.append("uuid", uuid);
15
16 const response = await fetch("/api/upload", {
17 method: "POST",
18 body: formData,

Attendance_Registermain.tsx9 matches

@HMDCreator•Updated 2 weeks ago
29
30 useEffect(() => {
31 fetchRecords();
32 const timer = setInterval(() => setCurrentTime(new Date()), 1000);
33 return () => clearInterval(timer);
34 }, []);
35
36 const fetchRecords = async () => {
37 try {
38 const response = await fetch('/records');
39 const data = await response.json();
40 setRecords(data);
41 } catch (err) {
42 setError('Failed to fetch records');
43 }
44 };
51
52 try {
53 const response = await fetch('/checkin', {
54 method: 'POST',
55 headers: { 'Content-Type': 'application/json' },
58
59 if (response.ok) {
60 fetchRecords();
61 setStaffName('');
62 setError('');
71 const handleCheckOut = async (recordId: number) => {
72 try {
73 const response = await fetch('/checkout', {
74 method: 'POST',
75 headers: { 'Content-Type': 'application/json' },
78
79 if (response.ok) {
80 fetchRecords();
81 setError('');
82 } else {
226 }
227
228 // Fetch records route
229 if (request.method === 'GET' && new URL(request.url).pathname === '/records') {
230 const result = await sqlite.execute(`

Staff_Connectmain.tsx2 matches

@HMDCreator•Updated 2 weeks ago
234 return Response.json({ messages: messages.rows });
235 } catch (error) {
236 console.error("Messages fetch error:", error);
237 return Response.json({ error: "Failed to fetch messages" }, { status: 500 });
238 }
239 }

cron_spacemain.tsx2 matches

@appsidal•Updated 2 weeks ago
3
4 try {
5 const response = await fetch(url);
6 if (!response.ok) {
7 throw new Error(`HTTP error! status: ${response.status}`);
11 return data;
12 } catch (error) {
13 console.error(`Fetch failed: ${error}`);
14 throw error;
15 }

FixItWandgeolocate.ts1 match

@wolf•Updated 2 weeks ago
20
21 try {
22 const response = await fetch(
23 `https://www.googleapis.com/geolocation/v1/geolocate?key=${apiKey}`,
24 {

FixItWandtranscribe.ts1 match

@wolf•Updated 2 weeks ago
13 */
14export async function transcribeAudio(audioB64: string): Promise<string> {
15 const audioResponse = await fetch(audioB64);
16 const audioBlob = await audioResponse.blob();
17

OpenTownieuseProjectFiles.ts4 matches

@charmaine•Updated 2 weeks ago
1import { useState, useEffect } from "https://esm.sh/react@18.2.0?dev";
2import { fetchProjectFiles } from "../utils/api.ts";
3
4interface UseProjectFilesProps {
15
16/**
17 * Custom hook to fetch and manage project files
18 */
19export function useProjectFiles({
38
39 try {
40 const filesData = await fetchProjectFiles({
41 bearerToken,
42 projectId,
51 }
52 } catch (err) {
53 console.error("Error fetching project files:", err);
54 setProjectFiles([]);
55 setError(err instanceof Error ? err : new Error(String(err)));

OpenTownietext-editor.ts1 match

@charmaine•Updated 2 weeks ago
136 let type_: "file" | "http" | "script";
137 if (path.includes("backend/index.ts")) type_ = "http";
138 if (file_text?.includes("export default app.fetch")) type_ = "http";
139 if ([".ts", ".tsx", ".js", ".jsx"].some(ext => path.endsWith(ext))) {
140 type_ = "script";

OpenTowniesystem_prompt.txt3 matches

@charmaine•Updated 2 weeks ago
233
234 // Inject data to avoid extra round-trips
235 const initialData = await fetchInitialData();
236 const dataScript = `<script>
237 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
280
2815. **API Design:**
282 - `fetch` handler is the entry point for HTTP vals
283 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago