Search

Results include substring matches and semantically similar vals. Learn more
j avatar
data
@j
// set by @j.untitled7914470 at 2023-01-12T00:46:44.709Z
Script
// set by @j.untitled7914470 at 2023-01-12T00:46:44.709Z
export let data = [
"body": "hello, world!"
"body": "hello, world!"
netux avatar
todepondLabLoginBanUser
@netux
An interactive, runnable TypeScript val by netux
HTTP (deprecated)
export default async function(req: Request): Promise<Response> {
const TABLE_NAME = "todepond_lab_login_users_with_times";
const body = await req.json();
const { username, password, type, target } = body;
const tpUserQuery = await sqlite.execute({
sql: `SELECT * FROM ${TABLE_NAME} WHERE username = ?`,
args: ["TodePond"],
if (tpUserQuery.rows.length === 0) {
return new Response(JSON.stringify({ error: "admin user not found" }), { status: 404 });
const tpUser = tpUserQuery.rows[0];
easrng avatar
normalizeDomain
@easrng
Normalize a domain. Handles trailing . and IDN.
Script
Normalize a domain. Handles trailing `.` and IDN.
import punycode from "npm:punycode@2.3.1";
export const normalizeDomain = (domain: string): string =>
punycode.toASCII(punycode.toUnicode(domain.replace(/^\.+|\.+$/, "")));
madelinecodes avatar
testingEmail
@madelinecodes
An interactive, runnable TypeScript val by madelinecodes
Script
export const testingEmail = (msg) => {
console.email(`>${msg}<`, "subject!");
yieldray avatar
draw
@yieldray
Draw
HTTP (deprecated)
# [Draw](https://yieldray-draw.web.val.run)
export const draw = () =>
new Response(
webpage(
title: "draw",
header: `<h1>Draw</h1>`,
footer: "<p>Powered by val.town</p>",
form(
action: "https://lily.deno.dev/",
method: "POST",
stevekrouse avatar
valTownTeam
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
export let valTownTeam = [
"stevekrouse",
"andreterron",
"rodrigotello",
"tmcw",
frederick_universe avatar
myApi
@frederick_universe
An interactive, runnable TypeScript val by frederick_universe
Script
export function myApi(name) {
return "hi " + name;
rodrigotello avatar
valTownCSSLink
@rodrigotello
An interactive, runnable TypeScript val by rodrigotello
Script
export let valTownCSSLink = "#1d4ed8";
jessmartin avatar
randomNumber
@jessmartin
An interactive, runnable TypeScript val by jessmartin
Script
export let randomNumber = () => {
return Math.random();
tmcw avatar
dsnyEventsFeed
@tmcw
DSNY Events Feed This turns the DSNY's SAFE Disposal Events feed in JSON into an iCal file that you can subscribe to from your calendar: https://tmcw-dsnyEventsFeed.web.val.run
HTTP (deprecated)
# DSNY Events Feed
![CleanShot 2023-09-21 at 11.14.30@2x.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/cfee7c3d-ed4d-482f-4eb3-a84159998
This turns the [DSNY's SAFE Disposal Events](https://www.nyc.gov/assets/dsny/site/services/harmful-products/safe-disposal) fe
https://tmcw-dsnyEventsFeed.web.val.run
export const dsnyEventsFeed = (async () => {
const ics = await import("npm:ics");
const events = await fetch(
"https://a827-donatenyc.nyc.gov/DSNYApi/api/Events/GetAllByBorough?borough=",
.then((r) => r.json());
const converted = events.map((evt) => {
vtdocs avatar
guestbookExample
@vtdocs
Guestbook Example See @vtdocs.guestbook to set up your own interactive guestbook. This is an example for testing!
Script
# Guestbook Example
See [`@vtdocs.guestbook`](https://www.val.town/v/vtdocs.guestbook) to set up your own interactive guestbook.
This is an example for testing!
import { generateGuestbookSnippet } from "https://esm.town/v/vtdocs/generateGuestbookSnippet";
export const guestbookExample = (req: express.Request, res: express.Response) => {
res.send(generateGuestbookSnippet("vtdocs", "guestbook"));
vtdocs avatar
getSteve
@vtdocs
An interactive, runnable TypeScript val by vtdocs
Script
import { getGithubUser } from "https://esm.town/v/vtdocs/getGithubUser";
export const getSteve = getGithubUser("stevekrouse");
monu_shaw avatar
variableIvoryEgret
@monu_shaw
An interactive, runnable TypeScript val by monu_shaw
HTTP
export default async function(req: Request): Promise<Response> {
let params = new URLSearchParams(req.url);
let name = params.get("https://monu_shaw-variableivoryegret.web.val.run/?passcode");
console.log(name);
return Response.json({ ok: true });
ralphite avatar
myApi
@ralphite
An interactive, runnable TypeScript val by ralphite
Script
export function myApi(name) {
return "hi " + name;
jamiedubs avatar
randomCardImage
@jamiedubs
An interactive, runnable TypeScript val by jamiedubs
HTTP (deprecated)
export default async function(req: Request): Promise<Response> {
try {
const response = await fetch(
"https://deckofcardsapi.com/api/deck/new/draw/?count=1",
const data = await response.json();
if (data.success && data.cards && data.cards.length > 0) {
const cardImage = data.cards[0].image;
return Response.json({ data: cardImage });
} else {
return Response.json({ error: "No cards found in the response." }, { status: 400 });