Search

Results include substring matches and semantically similar vals. Learn more
keo avatar
spaceTradersStatusTable
@keo
Simple Space Traders API status table. 100% generated by Townie AI.
HTTP
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
function StatusTable() {
const [status, setStatus] = useState(null);
useEffect(() => {
async function fetchStatus() {
try {
textDecoration: 'none'
function App() {
return <StatusTable />;
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
return new Response(`
yixiaojiu avatar
bilibili_comic
@yixiaojiu
An interactive, runnable TypeScript val by yixiaojiu
HTTP
export async function handler(request: Request) {
const res = await fetch("https://api.bilibili.com/x/activity/operation/list?source_id=630edcfddbd0b39ca7371ad2");
const data = await res.json();
fgeierst avatar
AriaSnapshotFromUrl
@fgeierst
compare https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/injected/ariaSnapshot.ts
HTTP
import { parseHTML } from 'https://esm.sh/linkedom@0.16.0';
export default async function server(request: Request): Promise<Response> {
// Parse the URL from the request query parameters
'Access-Control-Allow-Origin': '*'
// Utility functions (same as previous implementation)
const roleUtils = {
display: 'block'
function generateAriaTree(rootElement: Element) {
const visited = new Set<Node>();
return snapshot;
function renderAriaTree(ariaNode: any, options = {}) {
const lines: string[] = [];
pomdtr avatar
embed_demo
@pomdtr
An interactive, runnable TypeScript val by pomdtr
HTTP
console.log("hello world!")
</div>
export default function(req: Request) {
return new Response(
html,
stevekrouse avatar
getPublicKey
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
export async function getPublicKey(handle) {
let { publicKey } = await import(`/v/${handle}/publicKey`);
return publicKey;
elliotbraem avatar
getProfileProfilePage
@elliotbraem
@jsxImportSource https://esm.sh/react
HTTP
network: NETWORK_ID,
async function getProfile(username: string): Promise<Profile | null> {
const response = await social.get({
return profile;
function SkeletonLoader() {
return (
</div>
function BirthdayBanner({ name }: { name: string }) {
return (
</div>
function launchConfetti() {
const defaults = { startVelocity: 45, spread: 90, ticks: 100, zIndex: 1000 };
angle: 135,
function App({ initialAccountId }: { initialAccountId: string }) {
const [profile, setProfile] = useState<Profile | null>(null);
</div>
function getSocialLink(platform: string, username: string) {
const links: Record<string, string> = {
return links[platform] || "#";
function getSocialIcon(platform: string) {
const icons: Record<string, string> = {
return icons[platform] || "🔗";
export function client(accountId: string) {
createRoot(document.getElementById("root")).render(<App initialAccountId={accountId} />);
export default async function server(request: Request): Promise<Response> {
const url = new URL(request.url);
jjoak3 avatar
handsomeBlackChipmunk
@jjoak3
An interactive, runnable TypeScript val by jjoak3
Script
console.log("Welcome to the Console Greeting Script!");
function greetUser() {
const name = prompt("What's your name?");
if (name) {
dhvanil avatar
val_6ob0t5Fmjm
@dhvanil
An interactive, runnable TypeScript val by dhvanil
Script
export default async function handler(req) {
try {
const result = await (async () => {
function isPrime(num) {
if (num <= 1) return false;
return true;
function findLowestThreeDigitPrime() {
for (let num = 100; num < 1000; num++) {
janpaul123 avatar
valle_tmp_58066747016530698388629314307403
@janpaul123
// This val will respond with an HTML greeting to any HTTP request
HTTP
// This val will respond with an HTML greeting to any HTTP request
export default async function (req: Request): Promise<Response> {
return new Response(`
<html>
geanu02 avatar
valTownDailyInspo
@geanu02
An interactive, runnable TypeScript val by geanu02
Cron
import { valTownInspirationEmail } from "https://esm.town/v/rodrigotello/valTownInspirationEmail?v=79";
export async function valTownDailyInspo() {
return await valTownInspirationEmail();
julianprincipe avatar
nimbleWhitePorpoise
@julianprincipe
An interactive, runnable TypeScript val by julianprincipe
HTTP
export default async function server(request: Request): Promise<Response> {
// Support GET, POST, and HEAD requests
if (request.method === "HEAD") {
all avatar
waveForm
@all
@jsxImportSource https://esm.sh/react
HTTP
// Main App Component
function App() {
const [synth, setSynth] = useState(null);
</div>
function client() {
createRoot(document.getElementById("root")).render(<App />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
lilymachado avatar
wildlifeRescueApp
@lilymachado
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
function WildlifeRescueApp() {
const [image, setImage] = useState<{ file: File | null, preview: string }>({ file: null, preview: '' });
</div>
function client() {
createRoot(document.getElementById("root")).render(<WildlifeRescueApp />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
return new Response(`
zarutian avatar
ocaps_ink
@zarutian
An interactive, runnable TypeScript val by zarutian
HTTP
function step(time) {
_inkStory.currentChoices.forEach(function (choice) {
const eventListener = function (event) {
_inkStory.BindExternalFunction("str_concat", (a, b) => {
_inkStory.BindExternalFunction("urlfetch", (url) => {
_inkStory.BindExternalFunction("json_subscript", (json_data, sub) => {
_inkStory.BindExternalFunction(
_inkStory.BindExternalFunction("json_array_length", (json_data) => {
_inkStory.BindExternalFunction("query", (message, defaultValue) => {
_inkStory.BindExternalFunction("urlpost", (url, payload) => {
chen avatar
aqi
@chen
AQI Alerts Get email alerts when AQI is unhealthy near you. Set up Click Fork Change location (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into locations via nominatim's geocoder API . Click Run Background This val uses nominatim's geocoder to get your lat, lon, and air quality data from OpenAQ. It uses EPA's NowCast AQI Index calculation and severity levels. Learn more: https://www.val.town/v/stevekrouse.easyAQI
Cron
import { email } from "https://esm.town/v/std/email?v=9";
import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
export async function aqi(interval: Interval) {
const location = "narberth, pa"; // <-- change to place, city, or zip code
const data = await easyAQI({ location });