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/?q=fetch&page=549&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 7881 results for "fetch"(1029ms)

shortmain.tsx1 match

@vawogbemi•Updated 9 months ago
76});
77
78export default app.fetch;

viewOnValTownComponentmain.tsx1 match

@dthyresson•Updated 9 months ago
43app.get("/", (c) => c.html(<ValTownLink />));
44
45export default app.fetch;

featureflagsREADME.md2 matches

@samwho•Updated 9 months ago
25There are two endpoints:
26
27- `/` -- the root endpoint fetches all flags for the given user.
28- `/:id` -- fetches just one flag value, given by `:id`, for the given user.
29
30## Specifying users

animemain.tsx7 matches

@tempguy•Updated 9 months ago
10
11 const results = [];
12 const metaResponse = await fetch(
13 `https://cool-proxy.koyeb.app/hdiuhmalkmc9d0ck7UCFVGBJHN?destination=https://api.malsync.moe/mal/anime/${id}`,
14 );
22 const episodeIdentifier = `${data.identifier}-episode-${ep}`;
23 return [
24 fetch(`https://animetize-api.vercel.app/servers/${episodeIdentifier}`),
25 fetch(`https://animetize-api.vercel.app/watch/${episodeIdentifier}`),
26 ];
27 }
158
159 const results = [];
160 const metaResponse = await fetch(
161 `https://cool-proxy.koyeb.app/hdiuhmalkmc9d0ck7UCFVGBJHN?destination=https://api.malsync.moe/mal/anime/${id}`,
162 );
169 const episodeIdentifier = `${data.identifier}-episode-${ep}`;
170 return [
171 fetch(`https://animetize-api.vercel.app/servers/${episodeIdentifier}`),
172 fetch(`https://animetize-api.vercel.app/watch/${episodeIdentifier}`),
173 ];
174 }
222 );
223});
224export default app.fetch;

scarletSolemain.tsx3 matches

@tempguy•Updated 9 months ago
32 url: "https://d000d.com/e/9x3w3pu0xemy",
33 };
34 const req = await fetch("http://turnsolver.pythonanywhere.com/solve", {
35 method: "POST",
36 headers: { "Content-Type": "application/json" },
39 const tokenReq = await req.json();
40 const token = tokenReq.token;
41 const ver = await fetch(
42 `https://cool-proxy.koyeb.app/hdiuhmalkmc9d0ck7UCFVGBJHN?destination=`
43 + encodeURIComponent(`https://d0000d.com/dood?op=validate&gc_response=${token}`),
66 return c.json({ worked: true });
67});
68export default app.fetch;

redMonkeymain.tsx6 matches

@tempguy•Updated 9 months ago
1import { fetch as proxiedFetch } from "https://esm.town/v/std/fetch";
2import { customAlphabet } from "npm:nanoid";
3const nanoid = customAlphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", 10);
8 const id = url.split("/e/")[1];
9
10 const doodDataReq = await fetch(
11 `https://cool-proxy.koyeb.app/hdiuhmalkmc9d0ck7UCFVGBJHN?destination=`
12 + encodeURIComponent(`${url}`),
19 const path = doodData.match(/\$\.get\('\/pass_md5([^']+)/)?.[1];
20 const thumbnailTrack = doodData.match(/thumbnails:\s\{\s*vtt:\s'([^']*)'/);
21 const doodPageReq = await fetch(
22 `https://cool-proxy.koyeb.app/hdiuhmalkmc9d0ck7UCFVGBJHN?destination=`
23 + encodeURIComponent(`${baseUrl}/pass_md5${path}`),
70}
71export async function streamwish(ctx) {
72 const _embed = await fetch(ctx.url);
73 const embed = await _embed.text();
74 console.log(embed);
134 // if (Number(_) > 100000) throw new Error("limit reached");
135 // await blob.set("streamtapeLimit", `${Number(_) + 1}`);
136 const _embed = await proxiedFetch(
137 `https://proxy-worker.thunderspeed.workers.dev/proxy?destination=${encodeURIComponent(ctx.url)}`,
138 );
169
170export async function streamium(ctx) {
171 const _embed = await fetch(ctx.url);
172 // https://pump.watchfree.ax/start-play?imdbid=tt11389872&name=apple&season=&episode=
173 const embed = await _embed.text();

sqlite_adminmain.tsx1 match

@stevekrouse•Updated 9 months ago
10app.get("/", async (c) => c.html(await sqlite_admin_tables()));
11app.get("/:table", async (c) => c.html(await sqlite_admin_table(c.req.param("table"))));
12export default basicAuth(app.fetch, { verifyUser: (_, password) => verifyToken(password) });

retiredRedMarlinmain.tsx14 matches

@tempguy•Updated 9 months ago
1import { base } from "https://esm.town/v/tempguy/southcloud";
2
3async function fetchStreamLink() {
4 try {
5 const headers = {
8 "Accept-Language": "en-US,en;q=0.5",
9 "x-site": "anicrush",
10 "Sec-Fetch-Dest": "empty",
11 "Sec-Fetch-Mode": "cors",
12 "Sec-Fetch-Site": "same-site",
13 };
14
15 // Fetch search results
16 const search = await fetch("https://api.anicrush.to/shared/v2/movie/list?keyword=One Piece&limit=10&page=1", {
17 headers,
18 });
21 const id = searchResult.result.movies[0].id;
22
23 // Fetch server data
24 const serverData = await fetch(`https://api.anicrush.to/shared/v2/episode/servers?_movieId=${id}&ep=1`, {
25 headers,
26 });
28 const serverId = serverDataResult.result.sub[0].server;
29
30 // Fetch server link
31 const serverLink = await fetch(
32 `https://api.anicrush.to/shared/v2/episode/sources?_movieId=${id}&ep=1&sv=${serverId}&sc=sub`,
33 { headers },
36 const sid = new URL(serverLinkResult.result.link).pathname.split("/")[3];
37
38 // Fetch stream link
39 const streamLink = await fetch(`https://southcloud.tv/e/ajax/p-1/getSources?id=${sid}`);
40 const streamLinkResult = await streamLink.json();
41
43 console.log(base(streamLinkResult.sources)[0].file);
44 } catch (error) {
45 console.error("Error fetching stream link:", error);
46 }
47}
48
49// Call the function
50fetchStreamLink();

southcloudmain.tsx1 match

@tempguy•Updated 9 months ago
1import CryptoJS from "npm:crypto-js";
2const regex = /case (0[xX][\da-fA-F]+):([a-zA-Z\d]+)=(.),([a-zA-Z\d]+)=(.)/gm;
3const req = await fetch("https://southcloud.tv/js/player/a/sc/prod/p1-debug.min.js");
4const str = await req.text();
5let m;

whenfilmedmain.tsx4 matches

@tmcw•Updated 9 months ago
1// This val creates a movie guessing game using the TMDB API.
2// We'll fetch random movies from different years, present them to the user, and check their guesses.
3// Tradeoffs: We're using a free API with authentication for better data variety.
4
13}
14
15async function fetchRandomMovies() {
16 const currentYear = new Date().getFullYear()
17 const movies = []
23 }
24 chosen.add(year)
25 const response = await fetch(
26 `${TMDB_API_BASE}/discover/movie?language=en-US&sort_by=popularity.desc&include_adult=false&include_video=false&page=1&primary_release_year=${year}`,
27 { headers },
213
214 if (req.method === "GET") {
215 const movies = await fetchRandomMovies()
216 const uuid = crypto.randomUUID()
217 const moviesKey = `${author}.${name}.movies.${uuid}`

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago