Search

Results include substring matches and semantically similar vals. Learn more
stevekrouse avatar
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: {
maxm avatar
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;
wallek avatar
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, {
liamdanielduffy avatar
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());
stevekrouse avatar
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({
tmh avatar
myApi
@tmh
An interactive, runnable TypeScript val by tmh
Script
export function myApi(name) {
return "hi " + name;
tmcw avatar
question
@tmcw
An interactive, runnable TypeScript val by tmcw
Script
export function question() {
return "hello";
blakbelt78 avatar
myApi
@blakbelt78
interesting idea
Script
export function myApi(name) {
return "hi " + name;
aahiltn avatar
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",
stevekrouse avatar
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( {
brianleroux avatar
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);
rheber avatar
myApi
@rheber
An interactive, runnable TypeScript val by rheber
Script
export function myApi(name) {
return "hi " + name;
janpaul123 avatar
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" } });
vandyand avatar
myApi
@vandyand
An interactive, runnable TypeScript val by vandyand
HTTP
export function myApi(name) {
if (!name) {
return "hi you!";
refactorized avatar
myApi
@refactorized
An interactive, runnable TypeScript val by refactorized
Script
export function myApi(name) {
return "hi " + name;