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/image-url.jpg?q=fetch&page=193&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 11297 results for "fetch"(703ms)

WholeFoodsSaleWatcherREADME.md1 match

@fortes•Updated 1 week ago
6
71. The script runs daily as a cron job
82. It fetches the Whole Foods search page for GT Synergy Kombucha
93. It analyzes the page to detect if the product is on sale
104. If a sale is detected (and wasn't detected in the previous check), it sends an email notification

untitled-267new-file-7290.tsx2 matches

@gpalmer•Updated 1 week ago
1import { email } from "https://esm.town/v/std/email";
2async function emailRandomJoke() {
3 function fetchRandomJoke() {
4 const SAMPLE_JOKE = {
5 setup: "What do you call a group of disorganized cats?",
9 }
10
11 const randomJoke = fetchRandomJoke();
12 const setup = randomJoke.setup;
13 const punchline = randomJoke.punchline;
21async function checkForKombuchaSale(): Promise<{isOnSale: boolean, price?: string, saleDetails?: string}> {
22 try {
23 // Fetch the Whole Foods search page for GT Synergy Kombucha
24 const response = await fetch(PRODUCT_URL, {
25 headers: {
26 "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
29
30 if (!response.ok) {
31 throw new Error(`Failed to fetch Whole Foods page: ${response.status}`);
32 }
33

Raj124CreateAgentForm.tsx1 match

@rajshah9305•Updated 1 week ago
47
48 // Send the data to the server
49 const response = await fetch('/api/agents', {
50 method: 'POST',
51 body: data,

emailerREADME.md1 match

@selem•Updated 1 week ago
34For more advanced use cases, you can modify the code to:
35
36- Fetch dynamic content from an API
37- Send different emails based on the day of the week
38- Include personalized content

Raj124index.ts1 match

@rajshah9305•Updated 1 week ago
42
43// This is the entry point for HTTP vals
44export default app.fetch;

untitled-9908index.ts11 matches

@Mayuri•Updated 1 week ago
98 });
99 } catch (error) {
100 console.error("Error fetching resumes:", error);
101 return c.json<ApiResponse<null>>({
102 success: false,
103 error: "Failed to fetch resumes"
104 }, 500);
105 }
123 });
124 } catch (error) {
125 console.error("Error fetching resume:", error);
126 return c.json<ApiResponse<null>>({
127 success: false,
128 error: "Failed to fetch resume"
129 }, 500);
130 }
174 });
175 } catch (error) {
176 console.error("Error fetching job requirements:", error);
177 return c.json<ApiResponse<null>>({
178 success: false,
179 error: "Failed to fetch job requirements"
180 }, 500);
181 }
199 });
200 } catch (error) {
201 console.error("Error fetching job requirement:", error);
202 return c.json<ApiResponse<null>>({
203 success: false,
204 error: "Failed to fetch job requirement"
205 }, 500);
206 }
304 });
305 } catch (error) {
306 console.error("Error fetching screening results:", error);
307 return c.json<ApiResponse<null>>({
308 success: false,
309 error: "Failed to fetch screening results"
310 }, 500);
311 }
313
314// Export the app for HTTP val
315export default app.fetch;

demoindex.ts1 match

@yuxiaoy•Updated 1 week ago
53
54// Export the Hono app for HTTP val
55export default app.fetch;

demoroute.ts2 matches

@yuxiaoy•Updated 1 week ago
21 });
22 } catch (error) {
23 console.error("Error fetching chat history:", error);
24 return new Response(JSON.stringify({
25 error: "Failed to fetch chat history",
26 details: error instanceof Error ? error.message : String(error)
27 }), {

demochat.tsx7 matches

@yuxiaoy•Updated 1 week ago
10 const messagesEndRef = useRef<HTMLDivElement>(null);
11
12 // Fetch initial messages
13 useEffect(() => {
14 async function fetchMessages() {
15 try {
16 const response = await fetch("/api/history");
17 if (response.ok) {
18 const data = await response.json();
20 }
21 } catch (error) {
22 console.error("Failed to fetch message history:", error);
23 }
24
34 }
35
36 fetchMessages();
37 }, []);
38
48
49 try {
50 const response = await fetch("/api/chat", {
51 method: "POST",
52 headers: {
82 const handleClearChat = async () => {
83 try {
84 await fetch("/api/clear", { method: "POST" });
85 setMessages([{
86 id: "welcome",

fetch-socials4 file matches

@welson•Updated 23 hours ago
fetch and archive my social posts

fetchRssForSubcurrent2 file matches

@ashryanio•Updated 1 day ago