Search

Results include substring matches and semantically similar vals. Learn more
brownieinmotion avatar
georgiaTechRegistration
@brownieinmotion
// ported from https://github.com/brownie-in-motion/gt-waitlist-bot
HTTP
// ported from https://github.com/brownie-in-motion/gt-waitlist-bot
const ENDPOINT = "https://oscar.gatech.edu/pls/bprod/bwckschd.p_disp_detail_sched";
const TERM = "202402";
export async function georgiaTechRegistration(request: Request): Promise<Response> {
const course = new URL(request.url).searchParams.get("courseId")?.toString();
if (course === undefined) return Response.json({ error: "missing courseId" });
const url = new URL(ENDPOINT);
url.searchParams.set("term_in", TERM);
url.searchParams.set("crn_in", course);
const data = await fetch(url);
vladimyr avatar
midnightpubFeed
@vladimyr
// @see: https://git.sr.ht/~m15o/midnight-pub/tree/master/item/model/user.go#L28
HTTP
const BASE_URL = "https://midnight.pub";
// @see: https://git.sr.ht/~m15o/midnight-pub/tree/master/item/model/user.go#L28
const reUserFeed = /^\/(?<username>~[a-z0-9-_]+)\.(?<format>atom|rss)$/;
export default async function(req: Request): Promise<Response> {
const { pathname } = new URL(req.url);
const match = pathname.match(reUserFeed);
if (!match) {
return new Response(null, { status: 400 });
const { format, username } = match.groups;
const profileURL = new URL(`/${username}`, BASE_URL);
dhvanil avatar
web_jvEOd6FdXL
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export async function web_jvEOd6FdXL(req) {
return new Response(`<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dr. Nefarious's EVIL PLAN #2: Operation Rubber Duck Uprising!</title>
<style>
body {
background-color: #000;
nate avatar
feeds
@nate
Bluesky feed generator
HTTP
Bluesky feed generator
const EXCLUDES = [
"elon",
"facebook",
"musk",
"zuckerberg",
export default async function(req: Request): Promise<Response> {
const host = "nate-feeds.web.val.run";
const endpoint = `https://${host}`;
const url = new URL(req.url);
hvlck avatar
fetchReadable
@hvlck
// inspired by https://www.val.town/v/stevekrouse/fetchJSON
Script
// inspired by https://www.val.town/v/stevekrouse/fetchJSON
interface Readable {
title: string;
content: string;
textContent: string;
length: number;
excerpt: string;
byline: string;
dir: string;
siteName: string;
spolu avatar
test1
@spolu
An interactive, runnable TypeScript val by spolu
Script
export let test1 = async () => {
console.log("HEY");
fal avatar
camera_app
@fal
An interactive, runnable TypeScript val by fal
Script
import WebcamPage from "https://esm.sh/gh/fal-ai/fal-js@9cc7cf5456/apps/demo-nextjs-app-router/app/camera-turbo/page.tsx";
console.log(WebcamPage.toString());
csshsh avatar
npmExample
@csshsh
An interactive, runnable TypeScript val by csshsh
Script
export let npmExample = (async () => {
const _ = await import("npm:lodash-es"); // The Lodash library exported as ES modules.
const jsdom = await import("npm:jsdom");
console.log(jsdom);
return _.shuffle(_.zip([1, 2, 3, 4], [5, 6, 7, 8]));
ian avatar
aqi
@ian
An interactive, runnable TypeScript val by ian
Script
export let aqi = async () => {
let pm25 = (
await fetchJSON(
"https://api.openaq.org/v2/latest?" +
new URLSearchParams({
limit: "10",
page: "1",
location: "San Francisco",
offset: "0",
sort: "desc",
janpaul123 avatar
valle_tmp_087532467066469221171456423794679
@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(): Promise<Response> {
return new Response("Hello world");
stevekrouse avatar
form
@stevekrouse
Simle HTML Form & Handler This val demonstrates how to render an HTML form and handle submissions. View Live Form | View Data
HTTP
# Simle HTML Form & Handler
This val demonstrates how to render an HTML form and handle submissions.
[**View Live Form**](https://stevekrouse-form.web.val.run) | [**View Data**](https://www.val.town/v/stevekrouse.formDataEx)
![Screenshot 2023-08-28 at 15.37.04@2x.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/1ad7af89-7791-44e6-8bb4-873e2fa8
let { formDataEx } = await import("https://esm.town/v/stevekrouse/formDataEx");
export let form = async (req: Request) => {
if (req.method === "POST") { // treating POSTs as form submissions
let email = (await req.formData()).get("email") as string; // get the email address
formDataEx = formDataEx ?? []; // initialize the data val
formDataEx.push(email); // add the new form submission
dhvanil avatar
val_Qj8c8xTIqv
@dhvanil
An interactive, runnable TypeScript val by dhvanil
Script
export default async function handler(req) {
try {
const result = await (async () => {
function findLowestThreeDigitFibonacci() {
let a = 0, b = 1;
let lowestThreeDigit = null;
while (b < 1000) {
let temp = b;
b = a + b;
a = temp;
gaimeri17 avatar
quickOrangeLamprey
@gaimeri17
An interactive, runnable TypeScript val by gaimeri17
HTTP
export default async function(req: Request): Promise<Response> {
const body = await req.json();
let { username, password } = body;
if (!username || !password) {
return new Response(JSON.stringify({ error: "Missing username or password" }), { status: 400 });
if (password.length > 50) {
return new Response(JSON.stringify({ error: "Password too long" }), { status: 400 });
if (username.length > 50) {
return new Response(JSON.stringify({ error: "Username too long" }), { status: 400 });
const TABLE_NAME = "lab_login_users_with_times";
yieldray avatar
gists
@yieldray
Get A Website for Your Gists Example: https://yieldray-gists.web.val.run Usage: fork this val and replace with your github usename
HTTP
# Get A Website for Your Gists
Example: <https://yieldray-gists.web.val.run>
Usage: fork this val and replace with your github usename
const app = ServeRouter();
const USERNAME = "yieldray"; // <--- Replace with your Github username
const gistList: Array<Gist> = await fetch(`https://api.github.com/users/${USERNAME}/gists`).then((res) => res.json());
app.get("/", (req) => {
return Response.json(
gistList.map((gist) => ({
id: gist.id,
yusukebe avatar
cyanPanther
@yusukebe
An interactive, runnable TypeScript val by yusukebe
HTTP
import { Hono } from "npm:hono@4";
const app = new Hono();
app.get("/", (c) => c.text("Hello Val!!!"));
export default app.fetch;