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=109&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 8565 results for "fetch"(566ms)

keyboardNtfymain.tsx2 matches

@curtcoxUpdated 2 weeks ago
36 // 2️⃣ send to ntfy via the server‑side proxy
37 try {
38 const res = await fetch(`/${NTFY_TOPIC}`, {
39 method: "POST",
40 headers: { "Content-Type": "application/json" },
150 };
151
152 const ntfyResponse = await fetch(ntfyUrl, {
153 method: "POST",
154 headers: { "Content-Type": "application/json" },

groqllmsmain.tsx2 matches

@yawnxyzUpdated 2 weeks ago
6
7const getTextFromUrl = async (url) => {
8 const response = await fetch("https://r.jina.ai/"+url);
9 const text = await response.text();
10 return text;
44});
45
46export default (typeof Deno !== "undefined" && Deno.env.get("valtown")) ? app.fetch : app;
47

rotrankmain.tsx11 matches

@dcm31Updated 2 weeks ago
52 useEffect(() => {
53 if (!userId) return;
54 const fetchData = async () => {
55 setLoading(true);
56 try {
59 let gd = dg;
60 try {
61 const gr = await fetch("/api/characters");
62 if (gr.ok) {
63 const fg = await gr.json();
64 if (Array.isArray(fg) && fg.length > 0) gd = fg;
65 } else console.warn(`Global fetch fail: ${gr.status}`);
66 } catch (e) {
67 console.error("Err fetch global:", e);
68 }
69 setCharacters(gd);
70 let pd = dp;
71 try {
72 const pr = await fetch(`/api/personal-characters?userId=${userId}`);
73 if (pr.ok) {
74 const fp = await pr.json();
75 if (Array.isArray(fp) && fp.length > 0) pd = fp;
76 } else console.warn(`Personal fetch fail: ${pr.status}`);
77 } catch (e) {
78 console.error("Err fetch personal:", e);
79 }
80 setPersonalCharacters(pd);
81 } catch (e) {
82 console.error("Err fetchData:", e);
83 setCharacters([...CHARACTERS.map(c => ({ ...c }))]);
84 setPersonalCharacters([...CHARACTERS.map(c => ({ ...c }))]);
87 }
88 };
89 fetchData();
90 }, [userId]);
91 useEffect(() => {
160 console.log("Attempting to save rankings...");
161
162 const globalUpdate = fetch("/api/update-rankings", {
163 method: "POST",
164 headers: { "Content-Type": "application/json" },
166 body: JSON.stringify(updatedGlobalChars),
167 });
168 const personalUpdate = fetch("/api/update-personal-rankings", {
169 method: "POST",
170 headers: { "Content-Type": "application/json" },

ItalianBrainRotGeneratormain.tsx1 match

@dcm31Updated 2 weeks ago
16 setError(null);
17 try {
18 const response = await fetch('/generate-character', { method: 'POST' });
19 if (!response.ok) {
20 throw new Error(`HTTP error! status: ${response.status}`);

githubNotificationmain.tsx2 matches

@stevekrouseUpdated 2 weeks ago
1import { email } from "https://esm.town/v/std/email?v=11";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function githubNotification({ lastRunAt }) {
5 let events = (
6 await fetchJSON(
7 "https://api.github.com/users/worrydream/events",
8 ) || []

reactHonoStarterindex.ts2 matches

@stfnsrUpdated 2 weeks ago
21});
22
23// HTTP vals expect an exported "fetch handler"
24// This is how you "run the server" in Val Town with Hono
25export default app.fetch;

MyStevenssendDailyBrief.ts1 match

@billogiovanniUpdated 2 weeks ago
135 const lastSunday = today.startOf("week").minus({ days: 1 });
136
137 // Fetch relevant memories using the utility function
138 const memories = await getRelevantMemories();
139

myNewWebsiteindex.ts2 matches

@billogiovanniUpdated 2 weeks ago
21});
22
23// HTTP vals expect an exported "fetch handler"
24// This is how you "run the server" in Val Town with Hono
25export default app.fetch;

tst2main.tsx4 matches

@tallesjpUpdated 2 weeks ago
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function urlToMarkdown(url: string) {
4 try {
5 // Fetch the webpage content
6 const response = await fetch(url);
7 if (!response.ok) {
8 throw new Error(`Failed to fetch URL: ${response.status} ${response.statusText}`);
9 }
10

pondiversefetchCreations0 matches

@iliazeusUpdated 2 weeks ago
1import { blob } from "https://esm.town/v/std/blob";
2import { sqlite } from "https://esm.town/v/stevekrouse/sqlite";
3import { TABLE_NAME } from "./updateTable";
4
5export default async function(req: Request): Promise<Response> {

fetchPaginatedData2 file matches

@nbbaierUpdated 2 weeks ago

FetchBasic1 file match

@fredmoonUpdated 2 weeks ago