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=62&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 3119 results for "fetch"(359ms)

linksDB2saveTanaLink1 match

@nbbaier•Updated 1 week ago
55});
56
57export default app.fetch;
IcarusBot

IcarusBot.cursorrules5 matches

@wittiest•Updated 1 week ago
163```
164
1655. **fetchTranspiledJavaScript** - Fetch and transpile TypeScript to JavaScript:
166```ts
167const jsCode = await fetchTranspiledJavaScript("https://esm.town/v/username/project/path/to/file.ts");
168```
169
242
243 // Inject data to avoid extra round-trips
244 const initialData = await fetchInitialData();
245 const dataScript = `<script>
246 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
300
3015. **API Design:**
302 - `fetch` handler is the entry point for HTTP vals
303 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
304 - Properly handle CORS if needed for external access

valtowntownmain.tsx1 match

@shouser•Updated 1 week ago
173});
174
175export default app.fetch.bind(app);
176
177const css = `

Bates_botgetCalendarEvents.ts6 matches

@greasegum•Updated 1 week ago
8export default async function getCalendarEvents() {
9 try {
10 console.log("Fetching calendar events...");
11
12 // Get list of active calendars to fetch
13 const activeCalendars = getActiveCalendars();
14
36 }
37
38 console.log(`Fetching events for calendar: ${calendarConfig.name}`);
39
40 try {
42 const calendar = await pipeDreamGoogle("calendar", calendarConfig.accountId);
43
44 // Fetch events from this calendar
45 const response = await calendar.events.list({
46 calendarId: calendarConfig.id,
101 }
102 } catch (error) {
103 console.error(`Error fetching calendar ${calendarConfig.name}:`, error);
104 // Continue with other calendars even if one fails
105 }
109 return { success: true, count: totalEvents };
110 } catch (error) {
111 console.error("Error fetching calendar events:", error);
112 return { success: false, error: error.message };
113 }

familyApp.tsx1 match

@meltedfire•Updated 1 week ago
9 console.log("test");
10
11 const response = await fetch("/api/test", {
12 method: "POST",
13 headers: { "Content-Type": "application/json" },

familyapp2 matches

@meltedfire•Updated 1 week ago
27 ));
28
29// HTTP vals expect an exported "fetch handler"
30export default app.fetch;

evalUImain.tsx1 match

@shouser•Updated 1 week ago
65
66 try {
67 const response = await fetch('${httpEndpoint}', {
68 method: 'POST',
69 body: code,

my-first-val02_http.tsx3 matches

@stevetestproj•Updated 1 week ago
24
25 // Look up the user's location from their IP
26 const geoResponse = await fetch(`http://ip-api.com/json/${ip}`);
27 const geoData = await geoResponse.json();
28
75
76// ----------------------------- Export --------------------------------------
77// Export Hono app's fetch function for Val Town to run it.
78// Learn more running HTTP triggers: https://docs.val.town/vals/http/
79
80export default app.fetch;

Bates_bottestwebhook.ts1 match

@greasegum•Updated 1 week ago
1export default async function() {
2 const token = process.env.TELEGRAM_TOKEN;
3 const response = await fetch(`https://api.telegram.org/bot${token}/getWebhookInfo`);
4 return await response.json();
5}

Bates_botregisterwebhook.ts1 match

@greasegum•Updated 1 week ago
4 const secretToken = "7774243588191447439744915";
5
6 const response = await fetch(
7 `https://api.telegram.org/bot${token}/setWebhook`,
8 {

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago