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=1037&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 13267 results for "fetch"(4947ms)

pushmain.tsx2 matches

@jrmann100•Updated 8 months ago
1/** @jsxImportSource npm:hono@3/jsx */
2import { modifyFetchHandler as codeOnValTownBanner } from "https://esm.town/v/andreterron/codeOnValTown";
3import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth";
4import { Hono } from "npm:hono@3";
125
126export default codeOnValTownBanner(
127 passwordAuth(app.fetch, { verifyPassword: verifyToken }),
128);

valiantSalmonWarblermain.tsx1 match

@maxm•Updated 8 months ago
30 // handler may only run once now, where in the old runtime it
31 // ran on every request. To migrate your code, you may have to
32 // move some code that was outside your fetch handler to run inside it.
33 // </p>
34

valiantSalmonWarblermain.tsx1 match

@stevekrouse•Updated 8 months ago
22 handler may only run once now, where in the old runtime it
23 ran on every request. To migrate your code, you may have to
24 move some code that was outside your fetch handler to run inside it.
25 </p>
26

passionateBeigeButterflymain.tsx4 matches

@stevekrouse•Updated 8 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 })));

tvshowsmain.tsx2 matches

@tmcw•Updated 8 months ago
1import { dataToRSS } from "https://esm.town/v/Glench/dataToRSS"
2import { fetch } from "https://esm.town/v/std/fetch"
3import process from "node:process"
4
28 const show_id = TV_SHOWS_WATCHED[i]
29 const url = `https://api.themoviedb.org/3/tv/${show_id}?api_key=${process.env.tmdb_api_key}`
30 const resp = await fetch(url)
31 const show = await resp.json()
32 data.push(show)

getAppleDevicemain.tsx2 matches

@tmcw•Updated 8 months ago
1import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=5"
2
3export async function getAppleDevice(req: Request) {
4 const deviceId = new URL(req.url).searchParams.get("search_keywords") as string
5 if (!deviceId) return Response.json("Please provide a search_keywords query parameter")
6 const html = await fetchText(
7 `https://everymac.com/ultimate-mac-lookup/?search_keywords=${encodeURI(deviceId)}`,
8 )

hiraganaWordBuildermain.tsx6 matches

@ashryanio•Updated 8 months ago
88 };
89
90 const fetchImage = async (romaji) => {
91 setIsLoading(true);
92 try {
93 const response = await fetch(`/api/image/${romaji}`);
94 if (!response.ok) {
95 throw new Error("Failed to fetch image");
96 }
97 const data = await response.json();
103 }
104 } catch (error) {
105 console.error("Error fetching image:", error);
106 setImageData("");
107 } finally {
119 setInputStatus([]);
120 setIsComplete(false);
121 fetchImage(newWord.romaji);
122 setIsTransitioning(false);
123 }, 300);
275 });
276 } catch (error) {
277 console.error("Error fetching image:", error);
278 return new Response("Image not found", { status: 404 });
279 }

scholarlyIvoryWombatmain.tsx1 match

@stevekrouse•Updated 8 months ago
40
41 try {
42 const response = await fetch("/api/chat", {
43 method: "POST",
44 headers: { "Content-Type": "application/json" },

weatherGPTmain.tsx1 match

@tnordby•Updated 8 months ago
4let location = "brooklyn ny";
5let lang = "en";
6const weather = await fetch(
7 `https://wttr.in/${location}?lang=${lang}&format=j1`,
8).then(r => r.json());

debatePollAppmain.tsx7 matches

@laur3n•Updated 8 months ago
11
12 useEffect(() => {
13 fetchPolls();
14 }, []);
15
24 }, [polls]);
25
26 const fetchPolls = async () => {
27 const response = await fetch("/polls");
28 const data = await response.json();
29 setPolls(data);
32 const handleCreatePoll = async (e) => {
33 e.preventDefault();
34 const response = await fetch("/polls", {
35 method: "POST",
36 headers: { "Content-Type": "application/json" },
40 setNewPollQuestion("");
41 setNewPollOptions(["", ""]);
42 fetchPolls();
43 }
44 };
45
46 const handleVote = async (pollId, optionIndex) => {
47 const response = await fetch(`/polls/${pollId}/vote`, {
48 method: "POST",
49 headers: { "Content-Type": "application/json" },
51 });
52 if (response.ok) {
53 fetchPolls();
54 }
55 };

GithubPRFetcher

@andybak•Updated 9 hours ago

proxiedfetch1 file match

@jayden•Updated 1 day ago