Search

blobImages
@stevekrouse
Image downsizer and uploader
HTTP
import { fileToDataURL } from "https://esm.town/v/stevekrouse/fileToDataURL";
import { modifyImage } from "https://esm.town/v/stevekrouse/modifyImage";
import { chat } from "https://esm.town/v/stevekrouse/openai";
import { Hono } from "npm:hono@3";
function esmTown(url) {
return fetch(url, {
headers: {
reqEvaltown
@maxm
An interactive, runnable TypeScript val by maxm
HTTP
import net, { AddressInfo } from "node:net";
export default async function(req: Request): Promise<Response> {
return serveRequest(
encodeURIComponent(`
export default async function(req: Request): Promise<Response> {
return Response.json("I am within a worker!")
export async function serveRequest(req: Request, importUrl: string): Promise<Response> {
let port = await getFreePort();
resolve(port);
export async function isPortListening(port: number): Promise<boolean> {
let isListening = false;
nasaImage
@wallek
// View at https://wallek-nasaImage.web.val.run
HTTP
import { nasaImageDetails } from "https://esm.town/v/wallek/nasaImageDetails";
// View at https://wallek-nasaImage.web.val.run
export async function nasaImage() {
const { html } = await nasaImageDetails();
return new Response(html, {

serveReactDemo
@liamdanielduffy
An interactive, runnable TypeScript val by liamdanielduffy
Script
import { reactDemo } from "https://esm.town/v/liamdanielduffy/reactDemo";
import { serveAsHTML } from "https://esm.town/v/liamdanielduffy/serveAsHTML";
export function serveReactDemo(req, res) {
serveAsHTML(req, res, reactDemo());

robPikeIO
@stevekrouse
robpike.io A re-implementation of https://robpike.io/
HTTP
export default async function(req: Request): Promise<Response> {
return new Response(
new ReadableStream({

myApi
@tmh
An interactive, runnable TypeScript val by tmh
Script
export function myApi(name) {
return "hi " + name;
question
@tmcw
An interactive, runnable TypeScript val by tmcw
Script
export function question() {
return "hello";
jokeGen
@aahiltn
// Fetches a random joke.
Cron
import { email } from "https://esm.town/v/std/email?v=9?";
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",

resyBot
@stevekrouse
Resy bot This bot books restaurant reservations via Resy. Use it to snipe reservations at your favorite restaurant! How to use it Set up a scheduled val to call it like this: import { resyBot } from "https://esm.town/v/stevekrouse/resyBot?v=2";
import { email } from "https://esm.town/v/std/email?v=13";
export default async function (interval: Interval) {
const bookingInfo = await resyBot( {
slug: 'amaro-bar',
city: 'ldn',
day: '2023-07-05',
start: '19:00',
end: '21:00',
partySize: 2,
// Use https://www.val.town/settings/secrets for these!
email: Deno.env.get("resyEmail"),
password: Deno.env.get("resyPassword"),
})
// If the val doesn't error, it successfully made a booking!
// Send yourself an email like this:
await email({ text: bookingInfo, subject: 'resy bot made a booking for you!' })
} How it works This val makes the same requests that your browser would make when you reserve a slot on Resy (that's why it needs your login info – to request an auth token). When there isn't a matching slot, this val errors and nothing else happens. When a booking is available, this val books it and returns a description of the booking so you can email it to yourself (Resy will also email you). This val will then stop attempting bookings for you until you change one of the arguments you're passing (it concats the non-sensitive arguments and uses this as a key). Credit to @rlesser and @alp for their existing Resy vals (search for resy on here).
Script
import { email } from "https://esm.town/v/std/email?v=13";
export default async function (interval: Interval) {
const bookingInfo = await resyBot( {
scrapecapfriendly
@brianleroux
An interactive, runnable TypeScript val by brianleroux
HTTP
import { DOMParser } from "https://deno.land/x/deno_dom/deno-dom-wasm.ts";
export async function handler(request: Request) {
let url = "https://www.capfriendly.com/";
let res = await fetch(url);

myApi
@rheber
An interactive, runnable TypeScript val by rheber
Script
export function myApi(name) {
return "hi " + name;
valle_tmp_059037444149131925961380987213611
@janpaul123
// This val will respond with "Hello, World!" to all incoming HTTP requests.
HTTP
// This val will respond with "Hello, World!" to all incoming HTTP requests.
export default async function main(req: Request): Promise<Response> {
return new Response("Hello, World!", { headers: { "Content-Type": "text/plain" } });