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/$2?q=fetch&page=10&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 11101 results for "fetch"(581ms)

untitled-7141index.ts1 match

@riyo•Updated 10 hours ago
267});
268
269export default app.fetch;

Glancerdemo.ts1 match

@lightweight•Updated 10 hours ago
30 apiUrl.pathname = `/api/demo/${id}`;
31
32 const response = await fetch(apiUrl.toString());
33 const initialData = await response.json();
34

Glancerchess.tsx2 matches

@lightweight•Updated 10 hours ago
11
12 constructor() {}
13 async fetch(req: Request): Promise<Response> {
14 if (new URL(req.url).pathname === "/robots.txt") {
15 return new Response("User-agent: *\nDisallow: /");
250const sc = new StaticChess();
251
252export default analyticsHandlerWrapper(sc.fetch.bind(sc));
253

charmaineValSearchdeno.lock15 matches

@charmaine•Updated 11 hours ago
38 "integrity": "sha512-OF8fFQSkbL7vJY9rfuegK1R7sPgQ6kFMkDamiEccNUvieQ+3urzfDFI616oPl8V7T9zRmnTkSjMOImYCAVRVuw==",
39 "dependencies": [
40 "@libsql/isomorphic-fetch",
41 "@libsql/isomorphic-ws",
42 "js-base64",
43 "node-fetch@3.3.2"
44 ]
45 },
46 "@libsql/isomorphic-fetch@0.3.1": {
47 "integrity": "sha512-6kK3SUK5Uu56zPq/Las620n5aS9xJq+jMBcNSOmjhNf/MUvdyji4vrMTqD7ptY7/4/CAVEAYDeotUz60LNQHtw=="
48 },
72 "integrity": "sha512-kTPhdZyTQxB+2wpiRcFWrDcejc4JI6tkPuS7UZCG4l6Zvc5kU/gGQ/ozvHTh1XR5tS+UlfAfGuPajjzQjCiHCw=="
73 },
74 "@types/node-fetch@2.6.12": {
75 "integrity": "sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==",
76 "dependencies": [
107 "dependencies": [
108 "@types/node@18.19.87",
109 "@types/node-fetch",
110 "abort-controller",
111 "agentkeepalive",
112 "form-data-encoder",
113 "formdata-node",
114 "node-fetch@2.7.0"
115 ]
116 },
119 "dependencies": [
120 "@types/node@18.19.87",
121 "@types/node-fetch",
122 "abort-controller",
123 "agentkeepalive",
124 "form-data-encoder",
125 "formdata-node",
126 "node-fetch@2.7.0"
127 ]
128 },
131 "dependencies": [
132 "@types/node@18.19.87",
133 "@types/node-fetch",
134 "abort-controller",
135 "agentkeepalive",
136 "form-data-encoder",
137 "formdata-node",
138 "node-fetch@2.7.0"
139 ]
140 },
211 "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
212 },
213 "fetch-blob@3.2.0": {
214 "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
215 "dependencies": [
240 "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
241 "dependencies": [
242 "fetch-blob"
243 ]
244 },
327 "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="
328 },
329 "node-fetch@2.7.0": {
330 "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
331 "dependencies": [
333 ]
334 },
335 "node-fetch@3.3.2": {
336 "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
337 "dependencies": [
338 "data-uri-to-buffer",
339 "fetch-blob",
340 "formdata-polyfill"
341 ]

charmaineValSearchcomponents.tsx2 matches

@charmaine•Updated 11 hours ago
1221 <h3>Try searching for:</h3>
1222 <div className="search-examples">
1223 <a href="?q=fetch" className="example-link">fetch</a>
1224 <a href="?q=api" className="example-link">api</a>
1225 <a href="?q=database" className="example-link">database</a>
1375 <h3>Try searching for:</h3>
1376 <div className="search-examples">
1377 <a href="?q=fetch" className="example-link">fetch</a>
1378 <a href="?q=api" className="example-link">api</a>
1379 <a href="?q=database" className="example-link">database</a>

charmaineValSearchimport.ts3 matches

@charmaine•Updated 11 hours ago
29 if (userId && !processedUsers.has(userId)) {
30 try {
31 // Fetch user data
32 const user = await vt.users.retrieve(userId);
33
45 processedUsers.add(userId);
46 } catch (error) {
47 console.error(`Error fetching user ${userId}:`, error);
48 // Continue with project processing even if user fetch fails
49 }
50 }

charmaineValSearchdb.ts1 match

@charmaine•Updated 11 hours ago
884 const searchPattern = `%${searchText}%`;
885
886 // 3. Start all data fetching queries in parallel, regardless of result type
887 // This way we don't wait for counts to finish before starting data queries
888 const fileResultsPromise = withTiming(async () => {

charmaineValSearchclient.tsx7 matches

@charmaine•Updated 11 hours ago
6 let lastSearchTerm = '';
7 let debounceTimer;
8 let currentRequest = null; // To track the current fetch request
9 let requestCounter = 0; // To identify requests
10 let currentResults = [];
11 let selectedIndex = -1;
12
13 // Function to fetch typeahead results
14 async function fetchTypeahead(query) {
15 if (query.length < 1) {
16 hideResults();
32
33 try {
34 const response = await fetch(\`/typeahead?q=\${encodeURIComponent(query)}\`, { signal });
35 if (!response.ok) throw new Error('Network response was not ok');
36
51 // Ignore abort errors which happen when we cancel the request
52 if (error.name !== 'AbortError') {
53 console.error('Typeahead fetch error:', error);
54 }
55 } finally {
120 // If it's a new query (just one character), search immediately
121 if (query.length === 1) {
122 fetchTypeahead(query);
123 } else {
124 // Otherwise use debounce for better performance during typing
125 debounceTimer = setTimeout(() => {
126 fetchTypeahead(query);
127 }, 200); // Debounce delay
128 }

fetch_templateREADME.md3 matches

@gwoods22•Updated 11 hours ago
1# Website Fetch Request Template
2
3Template for sending fetch requests (typically grabbed from browser dev tools), looking for changes, and using [sendNotification](https://www.val.town/x/gwoods22/sendNotification) if changes are found.
4
5Remix and add a cron trigger to send requests on your schedule!
6
7Uses [cookieFetch](https://www.val.town/x/gwoods22/cookieFetch) to automatically manage and update cookies while sending requests. This is useful when you're grabbing an authenticated fetch request from a website's Network dev tools that returns response cookies that need to be added to follow up requests.

Geohashscript.js1 match

@anand_g•Updated 11 hours ago
55
56 try {
57 const response = await fetch('/geohash', {
58 method: 'POST',
59 headers: {

fetch_template2 file matches

@gwoods22•Updated 11 hours ago

HN-fetch-call3 file matches

@ImGqb•Updated 1 day ago
fetch HackerNews by API