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=1030&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 13344 results for "fetch"(1297ms)

diligentSapphireOrcamain.tsx4 matches

@gigmx•Updated 7 months ago
6 try {
7 const body = await req.json();
8 const apiResponse = await fetch("http://57.132.138.13:1865/message", {
9 method: "POST",
10 headers: {
37 if (url.pathname === "/api/health") {
38 try {
39 const apiResponse = await fetch("http://57.132.138.13:1865/");
40 return new Response(null, {
41 status: apiResponse.ok ? 200 : 500
247
248 // Test API connection through proxy
249 fetch("/api/health")
250 .then(response => {
251 if (!response.ok) throw new Error();
290
291 try {
292 const response = await fetch("/api/proxy", {
293 method: "POST",
294 headers: {

wittyTurquoiseDovemain.tsx7 matches

@all•Updated 7 months ago
205
206 useEffect(() => {
207 fetchSavedSnippets();
208 }, []);
209
210 async function fetchSavedSnippets() {
211 const response = await fetch("/snippets");
212 const snippets = await response.json();
213 setSavedSnippets(snippets);
216 async function handleSave() {
217 if (!code) return;
218 const response = await fetch("/snippets", {
219 method: "POST",
220 headers: { "Content-Type": "application/json" },
222 });
223 if (response.ok) {
224 fetchSavedSnippets();
225 }
226 }
227
228 async function handleDelete(id: number) {
229 const response = await fetch(`/snippets/${id}`, { method: "DELETE" });
230 if (response.ok) {
231 setSavedSnippets(snippets => snippets.filter(s => s.id !== id));
238
239 try {
240 const response = await fetch("/", {
241 method: "POST",
242 body: JSON.stringify({ prompt, currentCode: code }),

zwiftPortalScheduleREADME.md1 match

@dazzag24•Updated 7 months ago
1Fetch and parse the Zwift Climbing Portal Schedule XML from the Zwift CDN.
2
3Example usage:

newRSSItemsmain.tsx2 matches

@gwoods22•Updated 7 months ago
1import { fetchRSS } from "https://esm.town/v/stevekrouse/fetchRSS";
2
3export let newRSSItems = ({ url, lastRunAt }: { url: string; lastRunAt?: Date }) =>
4 fetchRSS(url)
5 .then(({ channel: { item } }) =>
6 (Array.isArray(item) ? item : [item]).filter(

png64main.tsx1 match

@all•Updated 7 months ago
50 formData.append('image', file);
51
52 const response = await fetch('?process=true', {
53 method: 'POST',
54 body: formData

squishyformmain.tsx5 matches

@yawnxyz•Updated 7 months ago
164 try {
165 const url = 'https://yawnxyz-executeproxy.web.val.run/execute';
166 const response = await fetch(url, {
167 method: 'POST',
168 headers: {
174 if (!response.ok) {
175 let errorJson = await response.json();
176 console.error('Fetch Error:', errorJson)
177 }
178
186 ...JSON.parse(data),
187 };
188 updateStore(newData, "fetch");
189 } catch (e) {
190 console.error('Failed to parse result:', e);
192 ...$parsedResult.get(),
193 ...data?.result?.data,
194 }, "fetch");
195 }
196 console.log('parsed:', data, $parsedResult.get());
634app.get("/", (c) => c.html(html));
635
636export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;
637
638

webdavServermain.tsx1 match

@pomdtr•Updated 7 months ago
298 });
299
300 return app.fetch(req);
301}
302

uniswapV3Positionmain.tsx7 matches

@midnightlightning•Updated 7 months ago
33/**
34 * This is the main function that looks up information about a Uniswap V3 position.
35 * Given a position ID in the URL, it fetches all the details about that position
36 * including what tokens are involved, their current prices, and whether the position
37 * is currently active.
55 }
56
57 // Fetch info about this liquidity position
58 let positionData;
59 try {
69 return Response.json({
70 ok: false,
71 message: `Failed to fetch position data: ${err.message}`,
72 });
73 }
88 ] = positionData;
89
90 // Fetch info about the two tokens in the position
91 const erc20ABI = parseAbi([
92 "function name() view returns (string)",
135 return Response.json({
136 ok: false,
137 message: `Failed to fetch token data: ${err.message}`,
138 });
139 }
155 return Response.json({
156 ok: false,
157 message: `Failed to fetch pool address: ${err.message}`,
158 });
159 }
171 return Response.json({
172 ok: false,
173 message: `Failed to fetch slot0 data: ${err.message}`,
174 });
175 }

inventiveAmethystSheepmain.tsx2 matches

@temptemp•Updated 7 months ago
10
11 for (const url of urls) {
12 const response = await fetch(url);
13 if (!response.ok) {
14 console.error(`Failed to fetch ${url}: ${response.statusText}`);
15 continue;
16 }

PhoenixProxymain.tsx1 match

@cephalization•Updated 7 months ago
42 const fullUrl = `${HOSTED_PHOENIX_BASE_URL}${Url.pathname}${Url.search}`;
43
44 return fetch(fullUrl, init);
45}

GithubPRFetcher

@andybak•Updated 1 day ago

proxiedfetch1 file match

@jayden•Updated 2 days ago