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=570&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 8234 results for "fetch"(891ms)

promptGenmain.tsx1 match

@all•Updated 8 months ago
29 setLoading(true);
30 try {
31 const response = await fetch("/generate", {
32 method: "POST",
33 headers: { "Content-Type": "application/json" },

multirouteHonomain.tsx1 match

@cofsana•Updated 8 months ago
108});
109
110export default app.fetch;
111
112const css = `

postmanClonemain.tsx3 matches

@maxm•Updated 8 months ago
1/**
2 * This val creates a Postman-like interface for testing HTTP requests directly in the browser.
3 * It uses React for the UI and the Fetch API to make requests.
4 * The server function serves the HTML and handles the API requests.
5 */
24 body: method !== 'GET' && body ? body : undefined
25 };
26 const res = await fetch('/proxy', {
27 method: 'POST',
28 headers: { 'Content-Type': 'application/json' },
108 const { url: targetUrl, options } = await request.json();
109 try {
110 const response = await fetch(targetUrl, options);
111 const data = await response.json();
112 return new Response(JSON.stringify({

niceTodoListmain.tsx1 match

@maxm•Updated 8 months ago
43 }
44
45 // Fetch todos from the database
46 const todos = await sqlite.execute(`SELECT * FROM ${KEY}_todos_${SCHEMA_VERSION} ORDER BY id DESC`);
47

multiplayerCirclesmain.tsx2 matches

@lisardo•Updated 8 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;

blob_adminmain.tsx2 matches

@supercreative•Updated 8 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));

getContentFromUrlmain.tsx16 matches

@yawnxyz•Updated 8 months ago
34 };
35
36 console.log('[getJinaContent] Fetching:', fullUrl.toString(), headers);
37
38 try {
39 const response = await fetch(fullUrl.toString(), {
40 method: 'GET',
41 headers: headers,
61 }
62 } catch (error) {
63 console.error('Error fetching from Jina:', error);
64 throw error;
65 }
94 };
95
96 console.log('[getFirecrawlContent] Fetching:', url, body);
97
98 try {
99 const response = await fetch("https://api.firecrawl.dev/v0/scrape", {
100 method: 'POST',
101 headers: {
115 return resultText;
116 } catch (error) {
117 console.error('Error fetching from Firecrawl:', error);
118 throw error;
119 }
129
130 let [response, metadata] = await Promise.all([
131 fetch(url),
132 getUrlMetadata(ogUrl)
133 ]);
182 return output
183 } catch (error) {
184 console.error('Error fetching the URL:', error);
185 return 'Error fetching the content: ', error.message || error || 'Unknown error.';
186 }
187};
263 };
264
265 const fetchMetadata = optsArray.includes('metadata') || optsArray.includes('doi') || optsArray.includes('citation');
266 let metadata;
267
268 if (fetchMetadata) {
269 metadata = await getUrlMetadata(ogUrl);
270 }
275 : await getJinaContent(serviceUrl, requestOptions);
276
277 if (fetchMetadata && !metadata) {
278 const html = crawlMode === 'fire'
279 ? await getFirecrawlContent(serviceUrl, { returnFormat: 'html' })
336 return output;
337 } catch (error) {
338 console.error('Error fetching the URL:', error);
339 throw new Error('Error fetching the content: ' + error.message || error || 'Unknown error.');
340 // return 'Error fetching the content: ' + error.message || error || 'Unknown error.';
341 }
342};
475
476
477export default app.fetch;
478

gsheet_callmain.tsx2 matches

@mmrech•Updated 8 months ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const gsheet_call = async (service_account, sheet_id, method, action, data) => {
9 };
10 const token = await getToken(service_account, googleAuthOptions);
11 const result = fetchJSON(
12 `https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`,
13 {

blob_adminmain.tsx2 matches

@mrdrone•Updated 8 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));

resumeConfigmain.tsx1 match

@siygle•Updated 8 months ago
5
6export const resumeConfig = {
7 // URL to fetch the resume JSON data. This should point to your raw resume JSON.
8 // If you want to host your resume JSON somewhere I recommend a setup like this on val town (https://www.val.town/v/iamseeley/resumeDetails) or a github gist.
9 // You can test out the resume view using my resume: https://iamseeley-resumedetails.web.val.run

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago