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/$%7Bart_info.art.src%7D?q=fetch&page=1147&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 13403 results for "fetch"(1584ms)

3I wanted to log this data so I can analyse which days do I game the most ? which periods do I log the most hours in my confort game (Dead By Daylight) ? And so on. I think the data viz possibilities are super interesting, just like when Valve releases the "Steam in review" at the end of the year
4
5This val fetches your recent playtime history from valve's API and stores it in a database every day !
6
7The project uses multiple vals to work:

weatherGPTmain.tsx1 match

@developersdigest•Updated 1 year 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 1 year 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 1 year ago
30
31
32export default app.fetch;

Appmain.tsx1 match

@xyc•Updated 1 year 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 1 year 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 1 year 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 1 year 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 1 year 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 1 year 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> {

GithubPRFetcher

@andybak•Updated 2 days ago

proxiedfetch1 file match

@jayden•Updated 2 days ago