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=108&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 8565 results for "fetch"(581ms)

SimpleAudioPlayerPWAapp.tsx3 matches

@dcm31•Updated 2 weeks ago
60 setError("");
61
62 const response = await fetch('/generate-speech', {
63 method: 'POST',
64 headers: { 'Content-Type': 'application/json' },
365 });
366
367 self.addEventListener('fetch', (event) => {
368 event.respondWith(
369 caches.match(event.request).then((response) => {
370 return response || fetch(event.request);
371 })
372 );

SimpleAudioPlayerPWAindex.ts3 matches

@dcm31•Updated 2 weeks ago
57
58 try {
59 const response = await fetch('/generate-speech', {
60 method: 'POST',
61 headers: { 'Content-Type': 'application/json' },
295 });
296
297 self.addEventListener('fetch', (event) => {
298 event.respondWith(
299 caches.match(event.request).then((response) => {
300 return response || fetch(event.request);
301 })
302 );

SimpleAudioPlayerindex.ts3 matches

@dcm31•Updated 2 weeks ago
45 if (!text.trim()) return;
46
47 const response = await fetch('/generate-speech', {
48 method: 'POST',
49 headers: { 'Content-Type': 'application/json' },
257 });
258
259 self.addEventListener('fetch', (event) => {
260 event.respondWith(
261 caches.match(event.request).then((response) => {
262 return response || fetch(event.request);
263 })
264 );

randomWikipediacron2 matches

@flymaster•Updated 2 weeks ago
2
3export default async function(interval: Interval) {
4 // fetch random article from wikipedia api
5 const randomArticle = await fetch(
6 "https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&meta=&generator=random&formatversion=2&exsentences=1&explaintext=1&grnnamespace=0",
7 );

cerebras_coderindex.ts1 match

@pedro169•Updated 2 weeks ago
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({

spacexindex.tsx2 matches

@moe•Updated 2 weeks ago
8
9const app = new Hono();
10export default app.fetch;
11
12const baseUrl = "https://spacex.page";
151
152 // TODO: refactor to notification sending func
153 const res = await fetch(notificationUrl, {
154 method: "POST",
155 headers: { "Content-Type": "application/json" },

ProtoRunsindex.ts2 matches

@nbbaier•Updated 2 weeks ago
24});
25
26// HTTP vals expect an exported "fetch handler"
27// This is how you "run the server" in Val Town with Hono
28export default app.fetch;
29

ProtoRunsApp.tsx3 matches

@nbbaier•Updated 2 weeks ago
23 const [runsResponse, setRunsResponse] = useState<RunsResponse>({ records: [] });
24
25 const fetchRuns = () => agent.com.atproto.repo
26 .listRecords({ collection: "me.wilb.test.run", repo: session.did })
27 .then(res => setRunsResponse(res.data as unknown as RunsResponse))
29 const deleteRun = (rkey: string) => agent.com.atproto.repo
30 .deleteRecord({ collection: "me.wilb.test.run", repo: session.did, rkey })
31 .then(() => fetchRuns())
32
33 return (
39 {session && <button
40 type="button"
41 onClick={fetchRuns}>
42 Get my runs
43 </button>}

ciphermain.tsx12 matches

@bao•Updated 2 weeks ago
337
338 useEffect(() => {
339 async function fetchQuote() {
340 try {
341 let loadedFromUUID = false;
342 if (uuid) {
343 const response = await fetch(`https://bao-simplevalueapi.web.val.run/getValue?id=${uuid}`);
344 const responseData = await response.json();
345
368 while (quote === "") {
369 const randomId = Math.floor(Math.random() * quoteCount) + 1;
370 const response = await fetch(`/quote?pageId=${randomId}`);
371 const responseData = await response.json();
372 if ((responseData?.quote?.length ?? 0) >= 70) {
387 setQuoteAuthor(author);
388 if (uuid) {
389 const writeResult = await fetch("https://bao-simplevalueapi.web.val.run/setValue", {
390 method: "POST",
391 headers: {
408 }
409 } catch (error) {
410 console.error("Failed to fetch quote:", error);
411 setLoadingError(`${error}`);
412 setIsLoading(false);
414 }
415
416 fetchQuote();
417 }, []);
418
544
545 if (uuid && name) {
546 await fetch("https://bao-simplevalueapi.web.val.run/addLog", {
547 method: "POST",
548 headers: {
560 }
561 if (!isMatch && uuid && name) {
562 await fetch("https://bao-simplevalueapi.web.val.run/addLog", {
563 method: "POST",
564 headers: {
584 appendToLocalStorage(cipher.original, quoteAuthor);
585 if (uuid && name) {
586 const writeResult = await fetch("https://bao-simplevalueapi.web.val.run/addLog", {
587 method: "POST",
588 headers: {
1211 const databaseId = "16e2c190bff080fd9ea8d2a8c21548b0";
1212
1213 // Use database query with filter instead of direct page fetch
1214 const response = await fetch(`https://api.notion.com/v1/databases/${databaseId}/query`, {
1215 method: "POST",
1216 headers: {
1253
1254 let keyword = "";
1255 console.log(`Fetched ${data.results.length} pages from Notion API:`);
1256 for (const page of data.results) {
1257 // console.log("Checking page", page.properties.ID);

ProtoRunsindex.ts2 matches

@wilhelm•Updated 2 weeks ago
24});
25
26// HTTP vals expect an exported "fetch handler"
27// This is how you "run the server" in Val Town with Hono
28export default app.fetch;
29

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago