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```
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 });
432});
433
434export const oldfashioned = app.fetch;
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;
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;
30});
31
32export const honoJSX = app.fetch;
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;
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({
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;
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;