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=353&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 7501 results for "fetch"(646ms)

groq_codermain.tsx1 match

@facundopri•Updated 3 months ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

sqlitemain.tsx2 matches

@stevekrouse•Updated 3 months ago
35
36async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
53 throw new Error("Invalid transaction mode provided to sqlite.batch. Must be 'write', 'read', or 'deferred.");
54 }
55 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
56 method: "POST",
57 headers: {

compactBlushGrasshoppermain.tsx10 matches

@tempdev•Updated 3 months ago
55
56async function PRORCPhandler(prorcp: string): Promise<string | null> {
57 const prorcpFetch = await fetch(`${BASEDOM}/prorcp/${prorcp}`);
58 const prorcpResponse = await prorcpFetch.text();
59
60 const scripts = prorcpResponse.match(/<script\s+src="\/([^"]*\.js)\?\_=([^"]*)"><\/script>/gm);
62 ? scripts?.[scripts.length - 2].replace(/.*src="\/([^"]*\.js)\?\_=([^"]*)".*/, "$1?_=$2")
63 : scripts?.[scripts.length - 1].replace(/.*src="\/([^"]*\.js)\?\_=([^"]*)".*/, "$1?_=$2");
64 const jsFileReq = await fetch(
65 `${BASEDOM}/${script}`,
66 {
72 "sec-ch-ua-mobile": "?0",
73 "sec-ch-ua-platform": "\"Windows\"",
74 "sec-fetch-dest": "script",
75 "sec-fetch-mode": "no-cors",
76 "sec-fetch-site": "same-origin",
77 "Referer": `${BASEDOM}/`,
78 "Referrer-Policy": "origin",
112 ? `https://vidsrc.net/embed/${type}?tmdb=${tmdbId}`
113 : `https://vidsrc.net/embed/${type}?tmdb=${tmdbId}&season=${season}&episode=${episode}`;
114 const embed = await fetch(url);
115 const embedResp = await embed.text();
116
122 const { servers, title } = await serversLoad(embedResp);
123
124 const rcpFetchPromises = servers.map(element => {
125 return fetch(`${BASEDOM}/rcp/${element.dataHash}`);
126 });
127 const rcpResponses = await Promise.all(rcpFetchPromises);
128 console.log(rcpResponses);
129 const prosrcrcp = await Promise.all(rcpResponses.map(async (response) => {

UserSpecificResource_Testmain.tsx1 match

@rozek•Updated 3 months ago
56 for (const TestCase of TestCases) {
57 try {
58 const Response = await fetch(ValURL, { headers:TestCase.Headers })
59 const Body = await Response.text()
60

wallpaperAppmain.tsx2 matches

@Buddha•Updated 3 months ago
25 const imageUrl = `https://maxm-imggenurl.web.val.run/${safePrompt}`;
26
27 // Prefetch image to ensure it loads
28 const response = await fetch(imageUrl);
29 if (!response.ok) {
30 throw new Error('Failed to generate image');

remasterbackendmain.tsx6 matches

@tempdev•Updated 3 months ago
20}
21
22export async function Fetcher(url: string, referer: string) {
23 const design = `?destination=${encodeURIComponent(url)}&referer=${encodeURIComponent(referer)}`;
24 const request = await fetch(
25 `https://1fd98a05-4959-42bc4-2f83-2c487c1cde6d.cloudflarepreviews.com/${design}`,
26 {
54 };
55 const baseUrl = "https://rapidplayers.com";
56 const embed = await Fetcher(`${baseUrl}/e/${id}`, baseUrl);
57 const pr = /p}\('(.*?)',(\d+),(\d+),'(.*?)'\.split/gm;
58 const ps = /sources:\[{file:\"(.*?)\"/gm;
86 };
87 const baseUrl = "https://d000d.com";
88 const doodData = await Fetcher(`${baseUrl}/e/${id}`, baseUrl);
89 console.log(doodData);
90 const poster = "";
92 const path = doodData.match(/\$\.get\('\/pass_md5([^']+)/)?.[1];
93 const thumbnailTrack = `https:${doodData.match(/thumbnails:\s\{\s*vtt:\s'([^']*)'/)?.[1]}`;
94 const doodPage = await Fetcher(`${baseUrl}/pass_md5${path}`, `${baseUrl}/e/${id}`);
95
96 returnData.extractedURL = `${doodPage}${nanoid()}?token=${dataForLater}&expiry=${Date.now()}`;
117 };
118 const baseUrl = "https://streamtape.com";
119 const embed = await Fetcher(`${baseUrl}/e/${id}`, "");
120 console.log(`${baseUrl}/e/${id}`);
121 const match = embed.match(/robotlink'\)\.innerHTML = '(.*)'/);

primewireUtilsmain.tsx4 matches

@tempdev•Updated 3 months ago
8
9async function search(imdbId: string) {
10 const searchResult = await fetch(`${primewireBase}/api/v1/show?key=${primewireApiKey}&imdb_id=${imdbId}`);
11 return await searchResult.json().then((searchResult) => {
12 return searchResult.id;
56 const searchResult = await search(imdbId);
57 console.log(`${primewireBase}/movie/${searchResult}`);
58 const title = await fetch(`${primewireBase}/movie/${searchResult}`);
59 const titleResp = await title.text();
60 const embeds = await getStreams(titleResp);
69 const searchResult = await search(imdbId);
70
71 const _season = await fetch(`${primewireBase}/tv/${searchResult}`, {});
72 const season = await _season.text();
73 const seasonPage = load(season);
81 if (!episodeLink) throw new NotFoundError("No episode links found");
82
83 const _title = await fetch(`${primewireBase}/${episodeLink}`);
84 const title = await _title.text();
85 const embeds = await getStreams(title);

sqliteExplorerAppmain.tsx4 matches

@caizoryan•Updated 3 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

receiveAndSavePointsmain.tsx1 match

@caizoryan•Updated 3 months ago
50});
51
52export default app.fetch;

react_client_forkmain.tsx5 matches

@charmaine•Updated 3 months ago
14 setNewTodo("");
15 // Sending new todo to server
16 await fetch('/add-todo', {
17 method: 'POST',
18 headers: {
27 setTodos(updatedTodos);
28 // Optionally, update server
29 await fetch('/delete-todo', {
30 method: 'POST',
31 headers: {
110
111function client() {
112 const fetchTodos = async () => {
113 const response = await fetch('/todos');
114 const todos = await response.json();
115 return todos;
116 };
117
118 fetchTodos().then(initialTodos => {
119 createRoot(document.getElementById("root")).render(<App initialTodos={initialTodos} />);
120 });

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago