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=1067&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 13280 results for "fetch"(4747ms)

emperorOfJapanCrawlermain.tsx2 matches

@jdan•Updated 9 months ago
1// This program crawls Wikipedia pages starting from an initial URL,
2// following links in the infobox and collecting page titles.
3// It uses the fetch API to make HTTP requests and cheerio for HTML parsing.
4
5import cheerio from "https://esm.sh/cheerio@1.0.0-rc.12";
12 visited.add(url);
13
14 const response = await fetch(url);
15 const html = await response.text();
16 const $ = cheerio.load(html);

cliServermain.tsx1 match

@pomdtr•Updated 9 months ago
2 constructor(public author: string) {}
3
4 fetch = async (req: Request) => {
5 const url = new URL(req.url);
6 const [name, ...args] = url.pathname.slice(1).split("/");

animemain.tsx7 matches

@tempdev•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;

textSummarizationComparisonToolmain.tsx1 match

@sharanbabu•Updated 9 months ago
188 setIsLoading(true);
189 try {
190 const response = await fetch("/summarize", {
191 method: "POST",
192 headers: { "Content-Type": "application/json" },

blob_adminmain.tsx2 matches

@nicopreme•Updated 9 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";
137});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));

scarletSolemain.tsx3 matches

@tempdev•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;

dailyDadJokemain.tsx2 matches

@cpdis•Updated 9 months ago
1import { email } from "https://esm.town/v/std/email";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,

legitimateTanTigermain.tsx13 matches

@sharanbabu•Updated 9 months ago
4 * The suggestions are cached in the browser to reduce API calls.
5 * It implements a two-step LLM process: first to get initial suggestions, then to filter them for sensibility and ethics.
6 * If the second LLM call fails, it displays "Failed to fetch" instead of showing results.
7 */
8
19 const suggestionCache = useRef({});
20
21 const fetchSuggestions = async (input) => {
22 if (suggestionCache.current[input]) {
23 setSuggestions(suggestionCache.current[input]);
28 setError("");
29 try {
30 const response = await fetch("/suggestions", {
31 method: "POST",
32 headers: { "Content-Type": "application/json" },
33 body: JSON.stringify({ query: input }),
34 });
35 if (!response.ok) throw new Error("Failed to fetch suggestions");
36 const data = await response.json();
37 if (data.error) {
43 }
44 } catch (error) {
45 console.error("Error fetching suggestions:", error);
46 setError("Failed to fetch");
47 setSuggestions([]);
48 } finally {
51 };
52
53 const debouncedFetchSuggestions = useRef(
54 debounce(fetchSuggestions, 300),
55 ).current;
56
57 useEffect(() => {
58 if (query.length > 2) {
59 debouncedFetchSuggestions(query);
60 } else {
61 setSuggestions([]);
115
116 try {
117 const response = await fetch("https://api.cerebras.ai/v1/chat/completions", {
118 method: "POST",
119 headers: {
137
138 if (!response.ok) {
139 throw new Error("Failed to fetch from Cerebras API");
140 }
141
146
147 // Second LLM call to filter suggestions
148 const filterResponse = await fetch("https://api.cerebras.ai/v1/chat/completions", {
149 method: "POST",
150 headers: {
190 } catch (error) {
191 console.error("Error calling Cerebras API:", error);
192 return new Response(JSON.stringify({ error: "Failed to fetch" }), {
193 status: 500,
194 headers: { "Content-Type": "application/json" },

geocodemain.tsx10 matches

@stevekrouse•Updated 9 months ago
39 }, [selectedLocation]);
40
41 const fetchSuggestions = async (input) => {
42 if (suggestionCache.current[input]) {
43 setSuggestions(suggestionCache.current[input]);
47 setIsLoading(true);
48 try {
49 const response = await fetch("/geocode", {
50 method: "POST",
51 headers: { "Content-Type": "application/json" },
52 body: JSON.stringify({ query: input }),
53 });
54 if (!response.ok) throw new Error("Failed to fetch suggestions");
55 const data = await response.json();
56 setSuggestions(data);
57 suggestionCache.current[input] = data;
58 } catch (error) {
59 console.error("Error fetching suggestions:", error);
60 setSuggestions([]);
61 } finally {
64 };
65
66 const debouncedFetchSuggestions = useRef(
67 debounce(fetchSuggestions, 300)
68 ).current;
69
70 useEffect(() => {
71 if (query.length > 2) {
72 debouncedFetchSuggestions(query);
73 } else {
74 setSuggestions([]);
128
129 try {
130 const response = await fetch("https://api.cerebras.ai/v1/chat/completions", {
131 method: "POST",
132 headers: {
146
147 if (!response.ok) {
148 throw new Error("Failed to fetch from Cerebras API");
149 }
150
158 } catch (error) {
159 console.error("Error calling Cerebras API:", error);
160 return new Response(JSON.stringify({ error: "Failed to fetch suggestions" }), {
161 status: 500,
162 headers: { "Content-Type": "application/json" },

dataUriGenAppmain.tsx1 match

@g•Updated 9 months ago
200app.get('/main.js', serve(js, 'text/javascript'));
201
202export default app.fetch;

GithubPRFetcher

@andybak•Updated 14 hours ago

proxiedfetch1 file match

@jayden•Updated 1 day ago