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=678&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"(2219ms)

maroonArmadillomain.tsx1 match

@stevekrouse•Updated 11 months ago
4app.get("/", (c) => c.text("Hello world!"));
5app.get("/yeah", (c) => c.text("Routing!"));
6export default app.fetch;

uniswapV3PositionREADME.md3 matches

@midnightlightning•Updated 11 months ago
6Find the token ID of the Uniswap position you wish to get details about. If you own the liquidity position, you can head to https://app.uniswap.org/pool and click on the v3 position. The ID of that position will be in the URL of the details page.
7
8Append the token ID to the end of this val's URL to fetch data about it (e.g. to get information about token ID `12345`, fetch the url `https://midnightlightning-uniswapv3position.web.val.run/12345`)
9
10# Reference
11This val fetches blockchain data from the following smart contracts:
12
13- **NonfungiblePositionManager(`0xc36442b4a4522e871399cd717abdd847ab11fe88`)** Manages the liquidity position tokens as an ERC721 contract. The `positions` function is used to determine what tokens and tick ranges the individual liquidity position has.
14- **UniswapV3Factory (`0x1F98431c8aD98523631AE4a59f267346ea31F984`)** Contract that manages liquidity pools, and acts as a registry to record where each pairing is deployed to. The `getPool` function is used to find where the smart contract for a specific pairing of ERC20 tokens is deployed to.
15- **ERC20 tokens** Each position has two tokens it's balancing between, and each token has its own instance of an ERC20 contract deployed to the blockchain. The `name` and `symbol` functions are used to determine how to describe each token, and the `decimals` function to determine how to scale the price value for the ratio between them.
16- **UniswapV3Pool** Contract that handles swaps between specific pairs of tokens. The `slot0` function is used to fetch the current price the two tokens are swapping at.

valTownAnalyticsmain.tsx2 matches

@iamseeley•Updated 11 months ago
34 }
35 // Do not await the response
36 fetch(`${httpEndpoint}/event?name=import-init&val=${runningValInfo.author}/${runningValInfo.name}`);
37 } catch (e) {
38 console.error(`Error initializing analytics: ${e}`);
45 const runningValInfo = getRunningValInfo();
46 return async (req: Request): Promise<Response> => {
47 fetch(`${httpEndpoint}/event?name=request&val=${runningValInfo.author}/${runningValInfo.name}&url=${req.url}`);
48 return handler(req);
49 };

allValsmain.tsx1 match

@stevekrouse•Updated 11 months ago
11
12const app = new Hono();
13export default app.fetch;
14app.get("/", async (c) => {
15 const vals = await sqlite.execute(

pinBlobmain.tsx1 match

@stevedylandev•Updated 11 months ago
10 data.append("file", file);
11
12 const res = await fetch("https://api.pinata.cloud/pinning/pinFileToIPFS", {
13 method: "POST",
14 headers: {

isMyWebsiteDownmain.tsx2 matches

@futurebird•Updated 11 months ago
9 let reason: string;
10 try {
11 const res = await fetch(URL, { redirect: "follow" });
12 if (res.status !== 200) {
13 reason = `(status code: ${res.status})`;
15 }
16 } catch (e) {
17 reason = `couldn't fetch: ${e}`;
18 ok = false;
19 }

resumeRecsmain.tsx1 match

@iamseeley•Updated 11 months ago
27 ];
28
29 const response = await fetch(endpoint, {
30 method: 'POST',
31 headers: {

fal_demomain.tsx1 match

@stevekrouse•Updated 11 months ago
48 );
49});
50export default app.fetch;

imgGenUrlmain.tsx2 matches

@martinbowling•Updated 11 months ago
21
22 if (cacheData && cacheData.expiration > Date.now()) {
23 return new Response((await fetch(cacheData.url)).body, { headers: { "content-type": "image/jpg" } });
24 }
25
30 await blob.setJSON(genKey(key), { url, expiration });
31
32 return new Response((await fetch(url)).body, {
33 headers: {
34 "content-type": "image/jpg",

AtelierHarfangToRSSmain.tsx5 matches

@vogelino•Updated 11 months ago
19export default async function(req: Request): Promise<Response> {
20 const url = new URL(`https://atelierharfang.ch`);
21 const html = await fetch(url.toString(), {
22 method: req.method,
23 headers: new Headers({
26 "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8",
27 "Accept-Language": "en-US,en;q=0.5",
28 "Sec-Fetch-Site": "cross-site",
29 "Sec-Fetch-Mode": "navigate",
30 "Sec-Fetch-User": "?1",
31 "Sec-Fetch-Dest": "document",
32 "Referer": "https://www.google.com/",
33 "sec-ch-ua": `"Not A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"`,

fetchPaginatedData2 file matches

@nbbaier•Updated 3 weeks ago

FetchBasic1 file match

@fredmoon•Updated 3 weeks ago