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/$1?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 10806 results for "fetch"(1264ms)

HN-fetch-callapi.tsx4 matches

@ImGqbâ€ĸUpdated 10 hours ago
20const BaseUrl = "https://hacker-news.firebaseio.com/v0";
21
22export function fetchItem(id: number | string): Promise<Item> {
23 return fetch(`${BaseUrl}/item/${id}.json`).then(ret => ret.json());
24}
25
26export function fetchMaxItemId(): Promise<string> {
27 // https://hacker-news.firebaseio.com/v0/maxitem.json
28 return fetch(`${BaseUrl}/maxitem.json`).then(ret => ret.text());
29}

openaiproxymain.tsx2 matches

@skutaansâ€ĸUpdated 10 hours ago
27 const authHeader = req.headers.get("Proxy-Authorization") || req.headers.get("Authorization");
28 const token = authHeader ? parseBearerString(authHeader) : undefined;
29 const meRes = await fetch(`${API_URL}/v1/me`, { headers: { Authorization: `Bearer ${token}` } });
30 if (!meRes.ok) {
31 return new Response("Unauthorized", { status: 401 });
64 });
65
66 const openAIRes = await fetch(url, {
67 method: req.method,
68 headers,

url-to-markdownindex.html9 matches

@peterhartreeâ€ĸUpdated 11 hours ago
77 }
78
79 async function fetchWithCORS(url) {
80 // Try direct fetch first
81 try {
82 const response = await fetch(url);
83 if (response.ok) {
84 return await response.text();
85 }
86 } catch (error) {
87 // If direct fetch fails due to CORS, try a CORS proxy
88 console.log('Direct fetch failed, trying CORS proxy...');
89 }
90
91 // Use a CORS proxy as fallback
92 const proxyUrl = `https://api.allorigins.win/get?url=${encodeURIComponent(url)}`;
93 const response = await fetch(proxyUrl);
94
95 if (!response.ok) {
96 throw new Error(`Failed to fetch: ${response.status} ${response.statusText}`);
97 }
98
103 async function extractArticle(url) {
104 try {
105 showStatus(`Fetching: ${url}`, 'info');
106
107 const html = await fetchWithCORS(url);
108
109 // Parse the HTML

url-to-markdownREADME.md2 matches

@peterhartreeâ€ĸUpdated 11 hours ago
14## How It Works
15
161. **Content Fetching**: Attempts direct fetch first, falls back to CORS proxy if needed
172. **Article Extraction**: Uses Mozilla Readability to identify and extract main article content
183. **Markdown Conversion**: Converts the extracted HTML to clean Markdown using Turndown
49Works in all modern browsers that support:
50- ES6 modules
51- Fetch API
52- Clipboard API (for copy functionality)
53- DOMParser

Demoindex.ts1 match

@vinodâ€ĸUpdated 11 hours ago
196});
197
198export default app.fetch;

Demoindex.html2 matches

@vinodâ€ĸUpdated 11 hours ago
169 };
170
171 const response = await fetch('/api/measure', {
172 method: 'POST',
173 headers: {
209 };
210
211 const response = await fetch('/api/report', {
212 method: 'POST',
213 headers: {

untitled-421main.tsx1 match

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

waho_pro_advancemain.tsx14 matches

@wahobdâ€ĸUpdated 11 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 13 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 13 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,

HN-fetch-call2 file matches

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

FRAMERFetchBasic1 file match

@bresnikâ€ĸUpdated 1 day ago