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=11&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 14043 results for "fetch"(2836ms)

Louoauth_handler.tsx2 matches

@jeffvincent•Updated 22 hours ago
62 });
63
64 const response = await fetch(tokenUrl, {
65 method: "POST",
66 headers: {
103 });
104
105 const response = await fetch(tokenUrl, {
106 method: "POST",
107 headers: {

SethGodinNewBlogPostNotifierREADME.md1 match

@lanly•Updated 22 hours ago
61. Remix this val
72. Receive updates every time your favorite blog posts, by switching out this URL in the val:
8`await fetch("https://seths.blog/feed/");`

SethGodinNewBlogPostNotifiermain.tsx2 matches

@lanly•Updated 22 hours ago
3export default async function (interval: Interval) {
4 try {
5 const response = await fetch("https://seths.blog/feed/");
6 const feedText = await response.text();
7
22 });
23 } catch (error) {
24 console.error("Error fetching or processing feed:", error);
25 }
26}

factoid-triviaApp.tsx19 matches

@bmitchinson•Updated 22 hours ago
40 }, []);
41
42 const fetchGameState = async () => {
43 try {
44 const response = await fetch('/api/game-state');
45 if (response.ok) {
46 const newGameState = await response.json();
58 }
59 } catch (err) {
60 console.error('Failed to fetch game state:', err);
61 }
62 };
64 const startPolling = () => {
65 if (pollIntervalRef.current) return;
66 pollIntervalRef.current = setInterval(fetchGameState, 2000); // Poll every 2 seconds
67 };
68
79
80 try {
81 const response = await fetch('/api/join', {
82 method: 'POST',
83 headers: { 'Content-Type': 'application/json' },
112
113 try {
114 const response = await fetch('/api/submit-fact', {
115 method: 'POST',
116 headers: { 'Content-Type': 'application/json' },
121
122 if (response.ok) {
123 await fetchGameState(); // Refresh game state
124 } else {
125 setError(data.error || 'Failed to submit fact');
138
139 try {
140 const response = await fetch('/api/start-round', {
141 method: 'POST',
142 headers: { 'Content-Type': 'application/json' },
146
147 if (response.ok) {
148 await fetchGameState(); // Refresh game state
149 } else {
150 setError(data.error || 'Failed to start round');
165
166 try {
167 const response = await fetch('/api/vote', {
168 method: 'POST',
169 headers: { 'Content-Type': 'application/json' },
178
179 if (response.ok) {
180 await fetchGameState(); // Refresh game state
181 } else {
182 setError(data.error || 'Failed to cast vote');
194
195 try {
196 const response = await fetch('/api/reveal', {
197 method: 'POST',
198 headers: { 'Content-Type': 'application/json' },
202
203 if (response.ok) {
204 await fetchGameState(); // Refresh game state
205 } else {
206 setError(data.error || 'Failed to reveal answers');
216
217 try {
218 const response = await fetch('/api/skip', {
219 method: 'POST',
220 headers: { 'Content-Type': 'application/json' },
224
225 if (response.ok) {
226 await fetchGameState(); // Refresh game state
227 } else {
228 setError(data.error || 'Failed to skip round');
238
239 try {
240 await fetch('/api/leave', {
241 method: 'POST',
242 headers: { 'Content-Type': 'application/json' },
247 setUserVote(null);
248 stopPolling();
249 await fetchGameState();
250 } catch (err) {
251 console.error('Leave error:', err);
262
263 try {
264 const response = await fetch('/api/admin/kick-all', {
265 method: 'POST',
266 headers: { 'Content-Type': 'application/json' },
277
278 // Refresh game state
279 await fetchGameState();
280
281 alert('All players have been kicked and game data cleared.');

factoid-triviaindex.ts1 match

@bmitchinson•Updated 22 hours ago
228});
229
230export default app.fetch;

tuempresaupdateSatCatalogsBlob.tsx2 matches

@arequipe•Updated 23 hours ago
1import { blob } from "https://esm.town/v/std/blob";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4// Base URL for the dist/json directory (using main branch)
40 const url = `${JSON_BASE_URL}${catalog}.json`;
41 console.log(`Downloading ${catalog} from ${url}`);
42 const response = await fetch(url);
43 if (!response.ok) {
44 throw new Error(`Failed to download ${catalog}: ${response.status} - ${response.statusText}`);

ChatEnhancedCommandPalette.tsx4 matches

@c15r•Updated 1 day ago
78 const argumentInputRefs = useRef<Map<string, HTMLInputElement>>(new Map());
79
80 // Initialize MCP clients and fetch prompts/tools
81 useEffect(() => {
82 const initializeClients = async () => {
104 }
105
106 // Fetch prompts and tools
107 const [prompts, tools] = await Promise.all([
108 client.listPrompts().catch(() => {
109 console.warn(`Failed to fetch prompts for ${server.name}`);
110 return [];
111 }),
112 client.listTools().catch(() => {
113 console.warn(`Failed to fetch tools for ${server.name}`);
114 return [];
115 }),

log-media-request-headersmain.tsx1 match

@eeeps•Updated 1 day ago
4
5 return new Promise((resolve, reject) => {
6 fetch(`https://o.img.rodeo${url.pathname}`, { headers: req.headers })
7 .then(response => response.body)
8 .then(rs => resolve(new Response(rs)));

tuempresaValidationCatalogGrok.tsx5 matches

@arequipe•Updated 1 day ago
11};
12
13async function fetchRecord(table: string, recordId: string) {
14 const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${table}/${recordId}`, {
15 headers: airtableHeaders,
16 });
17 if (!res.ok) throw new Error(`Failed to fetch record ${recordId} from ${table}: ${res.status}`);
18 return (await res.json()).fields;
19}
28
29 console.log(`Iniciando validación de catálogos SAT para Viaje ID: ${recordId}`);
30 const viaje = await fetchRecord(VIAJES_TABLE, recordId);
31 if (!viaje) throw new Error("Viaje no encontrado");
32
34 if (bienesIds.length === 0) throw new Error("Se requiere al menos un Bien");
35
36 const bienes = await Promise.all(bienesIds.map((id: string) => fetchRecord(BIENES_TABLE, id)));
37
38 console.log("Cargando catálogos SAT...");

tuempresaValidationCatalogGemini.tsx17 matches

@arequipe•Updated 1 day ago
1import { blob } from "https://esm.town/v/std/blob";
2import { fetch } from "https://esm.town/v/std/fetch";
3import { sqlite } from "https://esm.town/v/std/sqlite";
4
24 }
25
26 const fetchLinkedRecord = async (tableId: string, recordId: string) => {
27 const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${tableId}/${recordId}`, {
28 headers: airtableHeaders,
29 });
31 const errorText = await res.text();
32 // El error de Airtable será capturado aquí con el mensaje específico
33 throw new Error(`Airtable fetch failed for ${tableId}/${recordId}: ${res.status} - ${errorText}`);
34 }
35 return (await res.json()).fields;
36 };
37
38 const fetchMultipleLinkedRecords = async (tableId: string, recordIds: string[]) => {
39 if (!recordIds || recordIds.length === 0) return [];
40 const records = await Promise.all(recordIds.map(id => fetchLinkedRecord(tableId, id)));
41 return records;
42 };
43
44 const updateAirtableFields = async (targetTable: string, targetRecordId: string, fields: Record<string, any>) => {
45 const res = await fetch(`https://api.airtable.com/v0/${AIRTABLE_BASE_ID}/${targetTable}/${targetRecordId}`, {
46 method: "PATCH",
47 headers: airtableHeaders,
66 console.log("Base de datos de catálogos SAT cargada.");
67
68 const viajeData = await fetchLinkedRecord(VIAJES_TABLE, recordId);
69
70 const emisorId = viajeData.Emisor?.[0];
81 const [emisor, clienteOrigen, clienteDestino, origen, destino, unidad, operador, remolque, bienes] = await Promise
82 .all([
83 emisorId ? fetchLinkedRecord(CLIENTES_TABLE, emisorId) : Promise.resolve(null),
84 clienteOrigenId ? fetchLinkedRecord(CLIENTES_TABLE, clienteOrigenId) : Promise.resolve(null),
85 clienteDestinoId ? fetchLinkedRecord(CLIENTES_TABLE, clienteDestinoId) : Promise.resolve(null),
86 origenId ? fetchLinkedRecord(UBICACIONES_TABLE, origenId) : Promise.resolve(null),
87 destinoId ? fetchLinkedRecord(UBICACIONES_TABLE, destinoId) : Promise.resolve(null),
88 unidadId ? fetchLinkedRecord(UNIDADES_TABLE, unidadId) : Promise.resolve(null),
89 operadorId ? fetchLinkedRecord(OPERADORES_TABLE, operadorId) : Promise.resolve(null),
90 remolqueId ? fetchLinkedRecord(REMOLQUES_TABLE, remolqueId) : Promise.resolve(null),
91 fetchMultipleLinkedRecords(BIENES_TABLE, bienesIds),
92 ]);
93

FetchBasic2 file matches

@ther•Updated 6 days ago

GithubPRFetcher

@andybak•Updated 1 week ago