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=58&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 9977 results for "fetch"(1156ms)

44 });
45 } catch (error) {
46 console.error("Error fetching policy acceptance:", error);
47 return c.json({ error: "Failed to fetch policy acceptance status" }, 500);
48 }
49});
33 return c.json({ children });
34 } catch (error) {
35 console.error("Error fetching children:", error);
36 return c.json({ error: "Failed to fetch children" }, 500);
37 }
38});
46 return c.json({ children });
47 } catch (error) {
48 console.error("Error fetching children:", error);
49 return c.json({ error: "Failed to fetch children" }, 500);
50 }
51});
74 return c.json({ child });
75 } catch (error) {
76 console.error("Error fetching child:", error);
77 return c.json({ error: "Failed to fetch child" }, 500);
78 }
79});
1/**
2 * Cron job to fetch emails from dealflow application
3 * Runs every 60 minutes
4 */
5export default async function() {
6 try {
7 const response = await fetch("https://dealflow-pearl.vercel.app/fetch-emails", {
8 method: "GET",
9 });
10
11 if (!response.ok) {
12 throw new Error(`Failed to fetch emails: ${response.status} ${response.statusText}`);
13 }
14
15 const result = await response.text();
16 console.log("Successfully fetched emails:", result);
17 return { success: true, message: "Emails fetched successfully" };
18 } catch (error) {
19 console.error("Error fetching emails:", error);
20 return { success: false, error: error.message };
21 }

JOBHUBindex.ts1 match

@JudyAlx25•Updated 2 days ago
39
40// Export the Hono app for Val Town
41export default app.fetch;

JOBHUBapp.js29 matches

@JudyAlx25•Updated 2 days ago
17// State
18let username = localStorage.getItem('username') || '';
19let lastChatFetch = 0;
20let chatPollingInterval;
21
33
34 // Load initial data
35 fetchJobs();
36 fetchChatMessages();
37
38 // Set up event listeners
80}
81
82// Fetch jobs from the API
83async function fetchJobs() {
84 try {
85 jobsContainer.innerHTML = '<p class="text-center py-4"><span class="loading-spinner mr-2"></span>Loading jobs...</p>';
86
87 const response = await fetch('/api/jobs');
88 const data = await response.json();
89
90 if (!data.success) {
91 throw new Error(data.error || 'Failed to fetch jobs');
92 }
93
94 displayJobs(data.data);
95 } catch (error) {
96 console.error('Error fetching jobs:', error);
97 jobsContainer.innerHTML = `
98 <div class="text-center py-8 text-red-600">
99 <p>Failed to load job listings</p>
100 <button class="mt-2 px-4 py-2 bg-blue-600 text-white rounded" onclick="fetchJobs()">
101 Try Again
102 </button>
149 jobModal.classList.remove('hidden');
150
151 const response = await fetch(`/api/jobs/${jobId}`);
152 const data = await response.json();
153
154 if (!data.success) {
155 throw new Error(data.error || 'Failed to fetch job details');
156 }
157
183 `;
184 } catch (error) {
185 console.error('Error fetching job details:', error);
186 modalContent.innerHTML = `
187 <div class="text-center py-4 text-red-600">
210 submitBtn.disabled = true;
211
212 const response = await fetch('/api/jobs', {
213 method: 'POST',
214 headers: {
229
230 // Refresh job listings
231 fetchJobs();
232
233 // Post a chat message about the new job
238 };
239
240 await fetch('/api/chat', {
241 method: 'POST',
242 headers: {
246 });
247
248 fetchChatMessages();
249 }
250 } catch (error) {
260// Start polling for chat messages
261function startChatPolling() {
262 // Initial fetch
263 fetchChatMessages();
264
265 // Set up polling interval (every 5 seconds)
266 chatPollingInterval = setInterval(fetchChatMessages, 5000);
267}
268
269// Fetch chat messages
270async function fetchChatMessages() {
271 try {
272 const response = await fetch('/api/chat');
273 const data = await response.json();
274
275 if (!data.success) {
276 throw new Error(data.error || 'Failed to fetch chat messages');
277 }
278
279 displayChatMessages(data.data);
280 lastChatFetch = Date.now();
281 } catch (error) {
282 console.error('Error fetching chat messages:', error);
283 if (chatMessages.children.length === 0 || chatMessages.innerHTML.includes('Loading')) {
284 chatMessages.innerHTML = `
285 <div class="text-center py-4 text-red-600">
286 <p>Failed to load chat messages</p>
287 <button class="mt-2 px-4 py-2 bg-blue-600 text-white rounded" onclick="fetchChatMessages()">
288 Try Again
289 </button>
345
346 try {
347 const response = await fetch('/api/chat', {
348 method: 'POST',
349 headers: {
365 chatInput.value = '';
366
367 // Fetch latest messages
368 fetchChatMessages();
369 } catch (error) {
370 console.error('Error sending message:', error);

JOBHUBchat.ts2 matches

@JudyAlx25•Updated 2 days ago
17 return c.json({ success: true, data: messages.reverse() });
18 } catch (error) {
19 console.error("Error fetching chat messages:", error);
20 return c.json({ success: false, error: "Failed to fetch chat messages" }, 500);
21 }
22});

JOBHUBjobs.ts4 matches

@JudyAlx25•Updated 2 days ago
15 return c.json({ success: true, data: jobPostings });
16 } catch (error) {
17 console.error("Error fetching jobs:", error);
18 return c.json({ success: false, error: "Failed to fetch job postings" }, 500);
19 }
20});
35 return c.json({ success: true, data: job });
36 } catch (error) {
37 console.error("Error fetching job:", error);
38 return c.json({ success: false, error: "Failed to fetch job posting" }, 500);
39 }
40});

ALXApp.tsx10 matches

@nancyghaly•Updated 2 days ago
22 const [loading, setLoading] = useState(false);
23
24 // Fetch tutorials with current filter
25 const fetchTutorials = async () => {
26 setLoading(true);
27 try {
28 const response = await fetch("/api/tutorials/filter", {
29 method: "POST",
30 headers: { "Content-Type": "application/json" },
37 }
38 } catch (error) {
39 console.error("Error fetching tutorials:", error);
40 } finally {
41 setLoading(false);
45 // Apply filter changes
46 useEffect(() => {
47 fetchTutorials();
48 }, [filter]);
49
51 const handleAddTutorial = async (tutorial: any) => {
52 try {
53 const response = await fetch("/api/tutorials", {
54 method: "POST",
55 headers: { "Content-Type": "application/json" },
59 if (response.ok) {
60 setIsAddingTutorial(false);
61 fetchTutorials();
62 }
63 } catch (error) {
69 const handleUpdateProgress = async (tutorialId: number, status: 'not_started' | 'in_progress' | 'completed', teamMemberId?: number, notes?: string, progress?: number) => {
70 try {
71 await fetch(`/api/tutorials/${tutorialId}/progress`, {
72 method: "POST",
73 headers: { "Content-Type": "application/json" },
75 });
76
77 fetchTutorials();
78 } catch (error) {
79 console.error("Error updating progress:", error);
86
87 try {
88 const response = await fetch("/api/team-members", {
89 method: "POST",
90 headers: { "Content-Type": "application/json" },

ALXindex.ts1 match

@nancyghaly•Updated 2 days ago
177
178// Export the app for HTTP val
179export default app.fetch;

Weather-Mapindex.html7 matches

@devthom_studios•Updated 2 days ago
199
200 // Use Nominatim API to search for the location
201 const response = await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(query)}&limit=1`);
202
203 if (!response.ok) {
226 map.setView([lat, lon], 10);
227
228 // Trigger weather data fetch for this location
229 map.fireEvent('click', { latlng: L.latLng(lat, lon) });
230
339 }
340
341 // Handle map clicks to fetch and display weather data
342 let currentMarker = null;
343
352 document.getElementById('weather-container').classList.add('hidden');
353
354 // Fetch weather data from our API
355 const response = await fetch(`/api/weather/${lat}/${lon}`);
356 if (!response.ok) {
357 throw new Error('Failed to fetch weather data');
358 }
359
469 } catch (error) {
470 console.error('Error:', error);
471 document.getElementById('weather-placeholder').innerHTML = 'Error fetching weather data. Please try again.';
472 document.getElementById('weather-container').classList.add('hidden');
473 document.getElementById('weather-placeholder').classList.remove('hidden');

agentplex-deal-flow-email-fetch1 file match

@anandvc•Updated 2 days ago

proxyFetch2 file matches

@vidar•Updated 4 days ago