Search
untitled0045282
@eric
An interactive, runnable TypeScript val by eric
Script
import { getEmails } from "https://esm.town/v/eric/getEmails";
untitled0045282 = export async function asyncSubscribe() {
const s = await getEmails()
console.log(s)
Array.from(arguments).forEach(x => s.add(x))
await setEmails(s)
return emails.length
untitled_aquaBird
@pdlieber
// Fetches a random joke.
Cron
// Fetches a random joke.
function fetchRandomJoke() {
const SAMPLE_JOKE = {
"setup": "What do you call a group of disorganized cats?",
"punchline": "A cat-tastrophe.",
return SAMPLE_JOKE;
const randomJoke = fetchRandomJoke();
const setup = randomJoke.setup;
const punchline = randomJoke.punchline;
// Sends an email with the joke.
untitled_XDKXKxQt
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import { hnFollow1 } from "https://esm.town/v/stevekrouse/hnFollow1";
export const untitled_XDKXKxQt = hnFollow1({ lastRunAt: new Date() });
untitled_silverKrill
@dpetrouk
An interactive, runnable TypeScript val by dpetrouk
Script
export let untitled_silverKrill = (name) => {
return `
<html>
<head></head>
<body>
<h1>${name}</h1>
</body>
</html>
untitled_cyanOctopus
@shreyagarwal7924
// Fetches a random joke.
Cron
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
return response.json();
const randomJoke = await fetchRandomJoke();
const setup = randomJoke.setup;
const punchline = randomJoke.punchline;
// Sends an email with the joke.
export const emailRandomJoke = email({
untitled_pinkRoundworm
@stevekrouse
Comments (just add water) A self-contained comments system Val. Just fork this val and you have a complete (but extremely minimal) comment system!
HTTP (deprecated)
# Comments (just add water)
A self-contained comments system Val. Just fork this val and you have a complete (but extremely minimal) comment system!
const KEY = import.meta.url.split("?")[0];
export async function addComment(str) {
const comments = await blob.getJSON(KEY) as Array<string> ?? [];
comments.push(str);
await blob.setJSON(KEY, comments);
await email({ text: "New Comment Alert!: " + str });
export async function getComments() {
return await blob.getJSON(KEY) as Array<string> ?? [];
untitled_harlequinIguana
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
HTTP (deprecated)
export let untitled_harlequinIguana = (req) => Response.json("hi");
untitled_graySwordtail
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import { curl } from "https://esm.town/v/stevekrouse/curl";
export let untitled_graySwordtail = curl(
"https://stevekrouse-pixel.express.val.run/track",
untitled6372775
@eric
An interactive, runnable TypeScript val by eric
Script
import { getEmails } from "https://esm.town/v/eric/getEmails";
untitled6372775 = export async function subscribe() {
const s = await getEmails()
console.log(s)
Array.from(arguments).forEach(x => s.add(x))
setEmails(s)
return emails.length