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=106&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 8540 results for "fetch"(580ms)

spacexindex.tsx2 matches

@moeUpdated 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

@nbbaierUpdated 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

@nbbaierUpdated 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

@baoUpdated 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

@wilhelmUpdated 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

keyboardNtfymain.tsx2 matches

@curtcoxUpdated 2 weeks ago
36 // 2️⃣ send to ntfy via the server‑side proxy
37 try {
38 const res = await fetch(`/${NTFY_TOPIC}`, {
39 method: "POST",
40 headers: { "Content-Type": "application/json" },
150 };
151
152 const ntfyResponse = await fetch(ntfyUrl, {
153 method: "POST",
154 headers: { "Content-Type": "application/json" },

groqllmsmain.tsx2 matches

@yawnxyzUpdated 2 weeks ago
6
7const getTextFromUrl = async (url) => {
8 const response = await fetch("https://r.jina.ai/"+url);
9 const text = await response.text();
10 return text;
44});
45
46export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;
47

rotrankmain.tsx11 matches

@dcm31Updated 2 weeks ago
52 useEffect(() => {
53 if (!userId) return;
54 const fetchData = async () => {
55 setLoading(true);
56 try {
59 let gd = dg;
60 try {
61 const gr = await fetch("/api/characters");
62 if (gr.ok) {
63 const fg = await gr.json();
64 if (Array.isArray(fg) && fg.length > 0) gd = fg;
65 } else console.warn(`Global fetch fail: ${gr.status}`);
66 } catch (e) {
67 console.error("Err fetch global:", e);
68 }
69 setCharacters(gd);
70 let pd = dp;
71 try {
72 const pr = await fetch(`/api/personal-characters?userId=${userId}`);
73 if (pr.ok) {
74 const fp = await pr.json();
75 if (Array.isArray(fp) && fp.length > 0) pd = fp;
76 } else console.warn(`Personal fetch fail: ${pr.status}`);
77 } catch (e) {
78 console.error("Err fetch personal:", e);
79 }
80 setPersonalCharacters(pd);
81 } catch (e) {
82 console.error("Err fetchData:", e);
83 setCharacters([...CHARACTERS.map(c => ({ ...c }))]);
84 setPersonalCharacters([...CHARACTERS.map(c => ({ ...c }))]);
87 }
88 };
89 fetchData();
90 }, [userId]);
91 useEffect(() => {
160 console.log("Attempting to save rankings...");
161
162 const globalUpdate = fetch("/api/update-rankings", {
163 method: "POST",
164 headers: { "Content-Type": "application/json" },
166 body: JSON.stringify(updatedGlobalChars),
167 });
168 const personalUpdate = fetch("/api/update-personal-rankings", {
169 method: "POST",
170 headers: { "Content-Type": "application/json" },

ItalianBrainRotGeneratormain.tsx1 match

@dcm31Updated 2 weeks ago
16 setError(null);
17 try {
18 const response = await fetch('/generate-character', { method: 'POST' });
19 if (!response.ok) {
20 throw new Error(`HTTP error! status: ${response.status}`);

githubNotificationmain.tsx2 matches

@stevekrouseUpdated 2 weeks ago
1import { email } from "https://esm.town/v/std/email?v=11";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function githubNotification({ lastRunAt }) {
5 let events = (
6 await fetchJSON(
7 "https://api.github.com/users/worrydream/events",
8 ) || []

fetchPaginatedData2 file matches

@nbbaierUpdated 2 weeks ago

FetchBasic1 file match

@fredmoonUpdated 2 weeks ago