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/$%7Bsuccess?q=fetch&page=677&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 8693 results for "fetch"(1868ms)

weatherGPTmain.tsx1 match

@developersdigest•Updated 11 months ago
4let location = "toronto on";
5let lang = "en";
6const weather = await fetch(
7 `https://wttr.in/${location}?lang=${lang}&format=j1`,
8).then(r => r.json());

blob_adminmain.tsx2 matches

@bjtitus•Updated 11 months ago
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
133});
134
135export default modifyFetchHandler(passwordAuth(app.fetch));

honoJsxAlpineReactivemain.tsx1 match

@yawnxyz•Updated 11 months ago
30
31
32export default app.fetch;

Appmain.tsx1 match

@xyc•Updated 11 months ago
7import { ObjectInspector } from "https://esm.sh/react-inspector";
8
9async function fetchGgufMetadata(url: string) {
10 const { metadata, tensorInfos } = await gguf(url);
11 return { metadata, tensorInfos };

ageGlifREADME.md1 match

@fab1an•Updated 11 months ago
1a super simple JSON setter/getter using valtown blobs. use GET to fetch it, use POST to set it. expects the inbound data to be JSON for simplicity. use `?key=foobar` to specify different storage locations.
2
3set:

tinygoHttpExamplemain.tsx1 match

@maxm•Updated 11 months ago
1import { wasmHandler } from "https://esm.town/v/maxm/tinygoHttp";
2const resp = await fetch("https://maxm-wasmblobhost.web.val.run/ihml3eg6qee7q2navnnpjqysogqvzdy7.wasm");
3
4export const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));

Title_Extractormain.tsx10 matches

@willthereader•Updated 11 months ago
1import cheerio from "https://esm.sh/cheerio@1.0.0-rc.10";
2import { fetch } from "https://esm.town/v/std/fetch";
3
4// Helper function to retrieve CSRF token if needed
5async function getCsrfToken(url, cookies) {
6 try {
7 console.log("Fetching CSRF Token from URL:", url);
8 console.log("Using Cookies:", cookies);
9 const response = await fetch(url, {
10 headers: {
11 "User-Agent":
24 }
25 const html = await response.text();
26 console.log("Fetched HTML (CSRF Token Request):", html);
27
28 const $ = cheerio.load(html);
31 return csrfToken || "";
32 } catch (error) {
33 console.error("Error fetching CSRF token:", error);
34 return "";
35 }
36}
37
38// Function to fetch HTML content and extract titles
39async function titleExtractor(url, cookies, csrfToken) {
40 try {
41 console.log("Fetching URL:", url);
42 console.log("Using CSRF Token:", csrfToken);
43 const encodedUrl = encodeURI(url);
45 await new Promise(resolve => setTimeout(resolve, Math.floor(Math.random() * 1000) + 500));
46
47 const response = await fetch(encodedUrl, {
48 headers: {
49 "User-Agent":
63 }
64 const html = await response.text();
65 console.log("Fetched HTML:", html);
66
67 const $ = cheerio.load(html);
72 return titles;
73 } catch (error) {
74 console.error("Error fetching or parsing HTML:", error);
75 return [];
76 }

tinygoMandelbrotExamplemain.tsx1 match

@stevekrouse•Updated 11 months ago
1import { wasmHandler } from "https://esm.town/v/maxm/tinygoHttp";
2const resp = await fetch("https://maxm-wasmblobhost.web.val.run/ihml3eg6qee7q2navnnpjqysogqvzdy7.wasm");
3
4export const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));

tinygoMandelbrotExampleREADME.md1 match

@stevekrouse•Updated 11 months ago
16
17import { wasmHandler } from "https://esm.town/v/maxm/tinygoHttp";
18const resp = await fetch("https://maxm-wasmblobhost.web.val.run/jpxqvyy5tphiwehzklmioklpkpz4gpzs.wasm");
19const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));
20export default async function(req: Request): Promise<Response> {

gptApiFrameworkmain.tsx4 matches

@xkonti•Updated 11 months ago
397 * @example Deno usage:
398 * ```
399 * const { fetch } = gptApi.serve();
400 * export default { fetch };
401 * ```
402 */
403 serve(): typeof Hono.prototype.fetch {
404 return this.app.fetch;
405 }
406

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago