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/$%7Bsuccess?q=fetch&page=733&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 8419 results for "fetch"(843ms)

rateLimitedAsyncPoolREADME.md3 matches

@harryhood•Updated 1 year ago
6
7```
8async function fetchURL(url: string): Promise<string[]> {
9 const response = await fetch(url);
10 const html = await response.text();
11 const urls = extractUrlsFromResponse(html);
14
15const allUrls = (await rateLimitedAsyncPool(
16 ["url1", "url2", "url3"], 2, fetchURL, 500
17)).flat();
18```

emailSubscriptionREADME.md3 matches

@petermillspaugh•Updated 1 year ago
93. Add an HTML form to your frontend that calls `/send-verification`, or just use `/` to return a simple HTML form
104. Add a confirmation page on the frontend that calls `/confirm-verification`
115. Fork sibling Vals to [get verification email markup](https://www.val.town/v/petermillspaugh/fetchVerificationEmailHtml), [send verification emails](https://www.val.town/v/petermillspaugh/sendVerificationEmail), [create a list of newsletters](https://www.val.town/v/petermillspaugh/newsletters), [create a newsletter template](https://www.val.town/v/petermillspaugh/generateNewsletterJsx), [create an individual newsletter](https://www.val.town/v/petermillspaugh/january2024), [send test emails](https://www.val.town/v/petermillspaugh/sendTestEmailNewsletter), [send emails](https://www.val.town/v/petermillspaugh/sendEmailNewsletter), and [handle unsubscribe](https://www.val.town/v/petermillspaugh/unsubscribeFromNewsletter)
126. Optionally, fork cousin Vals to [view subscribers](https://www.val.town/v/petermillspaugh/getSubscribers), [email yourself daily subscriber count](https://www.val.town/v/petermillspaugh/dailySubscriptionStats), [email yourself a reminder to write your next newsletter](https://www.val.town/v/petermillspaugh/sendNewsletterReminder), and [send test emails](https://www.val.town/v/petermillspaugh/sendTestEmailNewsletter)
13
30 formData.append("email", email);
31
32 await fetch("https://petermillspaugh-emailSubscription.web.val.run/send-verification", {
33 method: "POST",
34 body: formData,
78 if (!email || !token) return;
79
80 const response = await fetch(`https://petermillspaugh-emailSubscription.web.val.run/confirm-verification?email=${email}&token=${token}`, {
81 method: "PUT",
82 });

oldfashionedmain.tsx1 match

@tmcw•Updated 1 year ago
432});
433
434export const oldfashioned = app.fetch;

emailRandomJokemain.tsx4 matches

@gab0503•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

emailRandomJokemain.tsx4 matches

@linafu2•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

honoJSXmain.tsx1 match

@pomdtr•Updated 1 year ago
30});
31
32export const honoJSX = app.fetch;

emailRandomJokemain.tsx4 matches

@tylerbinns•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

aqiPushGotifymain.tsx3 matches

@zane•Updated 1 year ago
1import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4import process from "node:process";
8 const data = await easyAQI({ location });
9 if (!interval.lastRunAt) {
10 const res = await fetchJSON(process.env.gotifyWebhookURL, {
11 method: "POST",
12 body: JSON.stringify({
17 }
18 if (data.severity.includes("Unhealthy")) {
19 const res = await fetchJSON(process.env.gotifyWebhookURL, {
20 method: "POST",
21 body: JSON.stringify({

emailRandomJokemain.tsx4 matches

@bellafratantonio•Updated 1 year ago
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;

SAMPLE_JOKEmain.tsx4 matches

@nguyentruongngu•Updated 1 year ago
6import { email } from "https://esm.town/v/std/email?v=9";
7
8// Fetches a random joke.
9async function fetchRandomJoke() {
10 const response = await fetch(
11 "https://official-joke-api.appspot.com/random_joke",
12 );
14}
15
16const randomJoke = await fetchRandomJoke();
17const setup = randomJoke.setup;
18const punchline = randomJoke.punchline;

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago