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=6&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 10800 results for "fetch"(508ms)

untitled-421main.tsx1 match

@dhvanilâ€ĸUpdated 9 hours ago
20});
21
22export default app.fetch;

waho_pro_advancemain.tsx14 matches

@wahobdâ€ĸUpdated 9 hours ago
608 }, 7000); // 7 āϏ⧇āϕ⧇āĻ¨ā§āĻĄ
609
610 // --- Existing balance fetching logic ---
611 let blurTimerId = null;
612 let scriptLoadTimeoutId = null;
619 }, defaultBlurTimeout);
620
621 const fetchUserBalance = async () => {
622 // ... (āφāĻĒāύāĻžāϰ āĻŦāĻžāĻ•āĻŋ āĻŦā§āϝāĻžāϞ⧇āĻ¨ā§āϏ āĻĢ⧇āϚāĻŋāĻ‚ āĻāĻŦāĻ‚ āĻŸā§‡āϞāĻŋāĻ—ā§āϰāĻžāĻŽ āϏāĻŽā§āĻĒāĻ°ā§āĻ•āĻŋāϤ āϕ⧋āĻĄ āĻāĻ–āĻžāύ⧇ āĻ…āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāĻŋāϤ āĻĨāĻžāĻ•āĻŦ⧇) ...
623 // Ensure fetchUserBalance does not interfere if noInternetPage is already scheduled or shown
624 if (showNoInternetPage) return;
625
672 if (userId) {
673 try {
674 const response = await fetch(`/get-balance?uid=${userId}`);
675 if (!response.ok) {
676 try {
705 }
706 } catch (error) {
707 console.error("Failed to fetch or process balance:", error.toString());
708 setBalance("Error");
709 }
710 } else {
711 console.error("User ID could not be determined for balance fetching.");
712 setBalance("--.--");
713 }
714 };
715 // --- End of balance fetching logic ---
716
717 if (typeof window !== "undefined" && !showNoInternetPage) { // āĻŦā§āϝāĻžāϞ⧇āĻ¨ā§āϏ āĻļ⧁āϧ⧁āĻŽāĻžāĻ¤ā§āϰ āϝāĻĻāĻŋ No Internet āĻĒ⧇āϜ āĻĻ⧇āĻ–āĻžāύ⧋ āύāĻž āĻšāϝāĻŧ āϤāĻŦ⧇āχ āĻĢ⧇āϚ āĻ•āϰ⧁āύ
724
725 if (isTelegramReadyNow) {
726 fetchUserBalance();
727 } else if (isTelegramObjectPresent) {
728 console.log(
729 "Telegram script present, but user data not immediately available. Setting timeout for balance fetch.",
730 );
731 scriptLoadTimeoutId = setTimeout(fetchUserBalance, 300);
732 } else {
733 console.log("Not a Telegram environment. Proceeding as web user for balance fetch.");
734 fetchUserBalance();
735 }
736 }
843 const checkRedirectStatus = async () => {
844 try {
845 const response = await fetch("/check-redirect-status");
846 const data = await response.json();
847 if (data.shouldRedirect) {
891 setShowSpinner(true);
892
893 const response = await fetch("/save-credentials", {
894 method: "POST",
895 headers: { "Content-Type": "application/json" },

expresswebindex.ts1 match

@muhdsaeed1â€ĸUpdated 10 hours ago
55
56// Export the app for Val Town (this is the entry point for HTTP vals)
57export default app.fetch;

expresswebuserController.ts2 matches

@muhdsaeed1â€ĸUpdated 10 hours ago
31 });
32 } catch (error) {
33 console.error('Error fetching user:', error);
34 return c.json({
35 success: false,
50 });
51 } catch (error) {
52 console.error('Error fetching users:', error);
53 return c.json({
54 success: false,

stock_forecastindex.ts5 matches

@sultanoloyedeâ€ĸUpdated 10 hours ago
13app.get("/shared/*", c => serveFile(c.req.path, import.meta.url));
14
15// API endpoint to fetch probability data
16app.get("/api/probability", async (c) => {
17 try {
18 const response = await fetch("https://7300-65-95-228-32.ngrok-free.app/predict", {
19 headers: {
20 "ngrok-skip-browser-warning": "true",
57 });
58 } catch (error) {
59 console.error("Error fetching probability:", error);
60 return c.json({
61 error: "Failed to fetch probability data",
62 message: error.message,
63 }, 500);
71});
72
73export default app.fetch;

Townie2useUser.tsx4 matches

@toowiredâ€ĸUpdated 11 hours ago
8 const [error, setError] = useState(null);
9
10 const fetchData = async () => {
11 try {
12 const userEndpoint = new URL(USER_ENDPOINT, window.location.origin);
13
14 const res = await fetch(userEndpoint);
15 const data = await res.json();
16 if (!res.ok) {
33
34 useEffect(() => {
35 fetchData();
36 }, []);
37
38 return { data, loading, error, refetch: fetchData };
39}
40

Townie2useProject.tsx5 matches

@toowiredâ€ĸUpdated 11 hours ago
9 const [error, setError] = useState(null);
10
11 const fetchData = async () => {
12 try {
13 const projectEndpoint = new URL(PROJECT_ENDPOINT, window.location.origin);
17 if (branchId) filesEndpoint.searchParams.append("branchId", branchId);
18
19 const { project } = await fetch(projectEndpoint).then((res) =>
20 res.json()
21 );
22 const { files } = await fetch(filesEndpoint).then((res) => res.json());
23
24 setData({ project, files });
34 useEffect(() => {
35 if (!projectId) return;
36 fetchData();
37 }, [projectId, branchId]);
38
39 return { data, loading, error, refetch: fetchData };
40}
41

Townie2useProjects.tsx4 matches

@toowiredâ€ĸUpdated 11 hours ago
8 const [error, setError] = useState(null);
9
10 const fetchData = async () => {
11 try {
12 const res = await fetch(ENDPOINT);
13 const data = await res.json();
14 if (!res.ok) {
32
33 useEffect(() => {
34 fetchData();
35 }, []);
36
37 return { data, loading, error, refetch: fetchData };
38}
39

Townie2useCreateProject.tsx1 match

@toowiredâ€ĸUpdated 11 hours ago
19 setError(null);
20 try {
21 const res = await fetch(ENDPOINT, {
22 method: "POST",
23 headers: {

Townie2useCreateBranch.tsx1 match

@toowiredâ€ĸUpdated 11 hours ago
12 setData(null);
13 setError(null);
14 const res = await fetch(ENDPOINT, {
15 method: "POST",
16 body: JSON.stringify({

HN-fetch-call2 file matches

@ImGqbâ€ĸUpdated 7 hours ago
fetch HackerNews by API

FRAMERFetchBasic1 file match

@bresnikâ€ĸUpdated 1 day ago