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=373&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 7885 results for "fetch"(1691ms)

jsoninvoicemain.tsx1 match

@alexwein•Updated 3 months ago
74});
75
76export default app.fetch;
77

bluesky_bot_templatemain.tsx6 matches

@alexwein•Updated 3 months ago
17}
18
19// Helper function to fetch SVG and convert to base64
20async function fetchSVGAsBase64(url: string): Promise<string> {
21 const response = await fetch(url);
22 if (!response.ok) {
23 throw new Error(`Failed to fetch SVG: ${response.status} ${response.statusText}`);
24 }
25 const svgText = await response.text();
48
49 try {
50 // Fetch SVG from the specified URL
51 const svgDataUri = await fetchSVGAsBase64("https://alexwein-fabwbogglelike.web.val.run/?svg=1");
52
53 // Upload blob to Bluesky

vividCopperWrenmain.tsx1 match

@vishu44•Updated 3 months ago
187
188 try {
189 const response = await fetch("/", {
190 method: "POST",
191 body: JSON.stringify({

reverentAquaCuckoomain.tsx1 match

@vishu44•Updated 3 months ago
187
188 try {
189 const response = await fetch("/", {
190 method: "POST",
191 body: JSON.stringify({

exuberantLimeReindeermain.tsx1 match

@gunisettigokul•Updated 3 months ago
187
188 try {
189 const response = await fetch("/", {
190 method: "POST",
191 body: JSON.stringify({

cerebras_codermain.tsx1 match

@gunisettigokul•Updated 3 months ago
187
188 try {
189 const response = await fetch("/", {
190 method: "POST",
191 body: JSON.stringify({

getLatestYouTubeVideoFromChannelmain.tsx2 matches

@samkingco•Updated 3 months ago
9 const rssUrl = `https://www.youtube.com/feeds/videos.xml?channel_id=${channelId}`;
10
11 const response = await fetch(rssUrl);
12 if (!response.ok) {
13 throw new Error("Failed to fetch RSS feed for channel");
14 }
15

rm_ios_testmain.tsx11 matches

@arfan•Updated 3 months ago
417 };
418
419 // [ADDED] Fetch the correct 434x0w.webp icon & store link via iTunes Search
420 const handleFetchIcon = async () => {
421 if (!editedApp.name) {
422 alert("Please enter a name first.");
424 }
425 try {
426 const res = await fetch(
427 `https://itunes.apple.com/search?term=${encodeURIComponent(editedApp.name)}&entity=software`,
428 );
444 } catch (error) {
445 console.error(error);
446 alert("Error fetching from iTunes. See console for details.");
447 }
448 };
491 <button onClick={onClose}>Cancel</button>
492 <button onClick={handleSearch}>Search App Store</button>
493 {/* [ADDED] The new button to fetch the correct icon + link */}
494 <button onClick={handleFetchIcon}>Fetch Icon</button>
495
496 {app?.id && (
575 // Get all apps, build categories
576 const loadApps = async () => {
577 const response = await fetch("/api/apps");
578 const data = await response.json();
579 setApps(data.apps);
603 const handleSave = async (updatedApp: App) => {
604 const method = updatedApp.id ? "PUT" : "POST";
605 await fetch("/api/apps", {
606 method,
607 headers: { "Content-Type": "application/json" },
614 const handleDelete = async (id: string) => {
615 if (!window.confirm("Are you sure you want to delete this app?")) return;
616 const resp = await fetch(`/api/apps/${id}`, { method: "DELETE" });
617 if (resp.ok) {
618 await loadApps();
631 // Export
632 const handleExportApps = async () => {
633 const response = await fetch("/api/apps");
634 const data = await response.json();
635 const jsonStr = JSON.stringify(data.apps, null, 2);
652 const text = await file.text();
653 const importedApps = JSON.parse(text);
654 await fetch("/api/apps/import", {
655 method: "POST",
656 headers: { "Content-Type": "application/json" },

emailValHandlerNomain.tsx8 matches

@martinbowling•Updated 3 months ago
140 lastRequestTime = Date.now();
141
142 const fetchOptions: RequestInit = {
143 method: "POST",
144 body: JSON.stringify({ url }),
147 // Only add headers if API key is available
148 if (apiKey) {
149 fetchOptions.headers = {
150 "Authorization": `Bearer ${apiKey}`,
151 "Content-Type": "application/json",
153 }
154
155 const response = await fetch("https://md.dhr.wtf/", fetchOptions);
156
157 if (!response.ok) {
162 markdownResults.push({ url, markdown });
163 } catch (error) {
164 console.error(`Error fetching markdown for ${url}:`, error);
165 markdownResults.push({ url, markdown: `Error fetching content: ${error.message}` });
166 }
167 }
172async function analyzeImage(imageAttachment, apiKey, transformedPrompt) {
173 try {
174 const response = await fetch("https://api.openai.com/v1/chat/completions", {
175 method: "POST",
176 headers: {
283 };
284
285 const response = await fetch(openaiUrl, {
286 method: "POST",
287 body: JSON.stringify(body),
413
414 // Send the request to OpenAI
415 const response = await fetch(openaiUrl, {
416 method: "POST",
417 body: JSON.stringify(body),

kanbanTodoListmain.tsx9 matches

@stevekrouse•Updated 3 months ago
40
41 useEffect(() => {
42 fetchTasks();
43 loadUserPreferences();
44 }, []);
72 }
73
74 async function fetchTasks() {
75 try {
76 const response = await fetch("/get-tasks");
77 const data = await response.json();
78 setTaskLists(data);
79 } catch (error) {
80 console.error("Error fetching tasks", error);
81 }
82 }
86
87 try {
88 const response = await fetch("/add-task", {
89 method: "POST",
90 headers: { "Content-Type": "application/json" },
107
108 try {
109 const response = await fetch("/move-task", {
110 method: "POST",
111 headers: { "Content-Type": "application/json" },
125 async function removeTask(taskId, column) {
126 try {
127 const response = await fetch("/delete-task", {
128 method: "POST",
129 headers: { "Content-Type": "application/json" },
142
143 try {
144 const response = await fetch("/move-task", {
145 method: "POST",
146 headers: { "Content-Type": "application/json" },
174 if (!editedTaskText.trim() || !taskBeingEdited) return;
175 try {
176 const response = await fetch("/update-task", {
177 method: "POST",
178 headers: { "Content-Type": "application/json" },

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago