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=523&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 15238 results for "fetch"(7905ms)

reactHonoStarterindex.ts2 matches

@johnroyallโ€ขUpdated 1 month 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;

NTFYweight.tsx1 match

@flymasterโ€ขUpdated 1 month ago
8 }
9
10 const response = await fetch(`https://ntfy.sh/${ntfyChannel}`, {
11 method: "POST",
12 body: `How much do you weigh?`,

subcurrentShufflerandom-subcurrent-post.ts5 matches

@ashryanioโ€ขUpdated 1 month ago
2 * Random Subcurrent RSS Aggregator Post Selector
3 *
4 * This Val fetches the RSS feed from Astoria Tech's Subcurrent RSS aggregator,
5 * selects a random post, and displays its metadata.
6 */
18export default async function (req: Request): Promise<Response> {
19 try {
20 // Fetch the RSS feed
21 const response = await fetch(
22 "https://astoria-tech.github.io/subcurrent-astro/rss.xml"
23 );
25 if (!response.ok) {
26 throw new Error(
27 `Failed to fetch RSS feed: ${response.status} ${response.statusText}`
28 );
29 }
172 <div class="max-w-2xl mx-auto bg-white p-6 rounded-lg shadow-md">
173 <h1 class="text-2xl font-bold text-red-700 mb-4">Error</h1>
174 <p class="mb-4">Sorry, something went wrong while fetching or processing the RSS feed:</p>
175 <div class="bg-red-50 border-l-4 border-red-500 p-4 mb-4">
176 <p class="text-red-700">${

bragreelindex.tsx1 match

@lightweightโ€ขUpdated 1 month ago
43
44// This is the entry point for HTTP vals
45export default app.fetch;

bragreelshowcase.tsx2 matches

@lightweightโ€ขUpdated 1 month ago
18 // console.log(host);
19 const url = `https://${host}/cache`;
20 const response = await fetch(url, {
21 method: "GET",
22 headers: {},
41 const host = new URL(c.req.url).host; // see: https://github.com/orgs/honojs/discussions/3644
42 const url = `https://${host}/cache`;
43 const response = await fetch(url, {
44 method: "GET",
45 headers: {},

ai-target-account-researchcompany_endpoint.tsx1 match

@wadeโ€ขUpdated 1 month ago
71 });
72
73 // fetch current status
74 const res = await sqlite.execute({
75 sql: `SELECT status, assistant_text, full_json
63
64 // 3. send to Anthropic
65 const batch = await fetch("https://api.anthropic.com/v1/messages/batches", {
66 method: "POST",
67 headers: {

bluesky-thinkup-tributewatcher.tsx5 matches

@stevekrouseโ€ขUpdated 1 month ago
21 let follows: any[] = [];
22 let cursor: string | undefined = undefined;
23 let pagesFetched = 0;
24
25 let seenDids = new Set();
54 // Take time between each page to avoid hammering bluesky too much
55 await new Promise(resolve => setTimeout(resolve, 100));
56 pagesFetched++;
57 console.log(`${pagesFetched} PAGES FETCHED`);
58 }
59
60 console.log(`${pagesFetched} PAGES FETCHED`);
61 console.log(`${follows.length} PROFILES FETCHED`);
62
63 type R = {
1// harvest_results.cron.ts โ€“ now authenticates results_url fetch
2import { sqlite } from "https://esm.town/v/std/sqlite";
3const log = (...m: unknown[]) => console.log(new Date().toISOString(), "โ”‚", ...m);
45// โ”€โ”€ batch handler โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
46async function handleBatch(id: string) {
47 const info = await fetch(`https://api.anthropic.com/v1/messages/batches/${id}`, {
48 headers: { "x-api-key": API_KEY!, "anthropic-version": VERSION_HEADER },
49 }).then(r => r.json());
53
54 // โœ… authenticated download
55 const raw = await fetch(info.results_url, {
56 headers: { "x-api-key": API_KEY!, "anthropic-version": VERSION_HEADER },
57 }).then(r => r.text());

bluesky-thinkup-tributewatcher.tsx5 matches

@tmcwโ€ขUpdated 1 month ago
21 let follows: any[] = [];
22 let cursor: string | undefined = undefined;
23 let pagesFetched = 0;
24
25 let seenDids = new Set();
54 // Take time between each page to avoid hammering bluesky too much
55 await new Promise(resolve => setTimeout(resolve, 100));
56 pagesFetched++;
57 console.log(`${pagesFetched} PAGES FETCHED`);
58 }
59
60 console.log(`${pagesFetched} PAGES FETCHED`);
61 console.log(`${follows.length} PROFILES FETCHED`);
62
63 type R = {

fake-https1 file match

@blazemcworldโ€ขUpdated 6 days ago
simple proxy to fetch http urls using https

testWeatherFetcher1 file match

@sjaskeprutโ€ขUpdated 2 weeks ago