Search

references
@mgruel
An interactive, runnable TypeScript val by mgruel
Script
"name": string;
"referencedAt": string;
export async function references({ token, since, until, offset, limit }: {
token: string;
since?: Date;
Ray
@Val11
Hello!!! Feel free to mess around with this val and make it your own :). Just click on "Fork" in the top right. You can change the phrases that show up as you click no, you can change the firstImg and secondImg, maybe even add more images. And you can also change the colors and any of the text on the screen! Have fun with it and hopefully your crush says yes hehe.
HTTP
const NO_PHRASES = [
function App() {
const [noClicks, setNoClicks] = useState(0);
</div>
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(
graphqlAPIEndpoint
@flesch
// Define the GraphQL schema
HTTP
resolve: () => "Hello from Val Town GraphQL API!",
// Function to handle GraphQL requests
async function handleGraphQLRequest(request: Request): Promise<Response> {
const { query, variables } = await request.json();
headers: { "Content-Type": "application/json" },
// HTTP handler function
export default altairClient(async function(req: Request): Promise<Response> {
return handleGraphQLRequest(req);
// Without the Altair GraphQL client:
// export default async function(req: Request): Promise<Response> {
// if (req.method === "POST") {
HAHAHAHAHA
@yuaaangabaa
Hello!!! Feel free to mess around with this val and make it your own :). Just click on "Fork" in the top right. You can change the phrases that show up as you click no, you can change the firstImg and secondImg, maybe even add more images. And you can also change the colors and any of the text on the screen! Have fun with it and hopefully your crush says yes hehe.
HTTP
"Ana raka do",
function App() {
const [noClicks, setNoClicks] = useState(0);
</div>
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(
cerebras_coder
@code01
This is an AI code assistant powered by Cerebras , running llama3.3-70b. Inspired by Hassan's Llama Coder . Setup Sign up for Cerebras Get a Cerebras API Key Save it in a Val Town environment variable called CEREBRAS_API_KEY Todos I'm looking for collaborators to help. Fork & send me PRs! [ ] Experiment with two prompt chain (started here )
HTTP
function Hero({
Turn your ideas into fully functional apps in{" "}
function App() {
function handleStarterPromptClick(promptItem: typeof prompts[number]) {
async function handleSubmit(e: React.FormEvent | string) {
function handleVersionChange(direction: "back" | "forward") {
function client() {
function extractCodeFromFence(text: string): string {
async function generateCode(prompt: string, currentCode: string) {
export default async function cerebras_coder(req: Request): Promise<Response> {
indigoWombat
@josh_len
// 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",

parseXML
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
export async function parseXML(xml) {
const { XMLParser } = await import("https://esm.sh/fast-xml-parser@4.1.2");
const parser = new XMLParser();
valentine
@Leif
Hello!!! Feel free to mess around with this val and make it your own :). Just click on "Fork" in the top right. You can change the phrases that show up as you click no, you can change the firstImg and secondImg, maybe even add more images. And you can also change the colors and any of the text on the screen! Have fun with it and hopefully your crush says yes hehe.
HTTP
"This is the last time before I tell my mom SERIOUSLY",
function App() {
const [noClicks, setNoClicks] = useState(0);
</div>
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(
solidExample
@mhalle
@jsxImportSource https://esm.sh/solid-jsx
HTTP
/** @jsxImportSource https://esm.sh/solid-jsx */
import { renderToString } from "npm:solid-js/web";
function calc() {
return 4 + 5;
function getMarkup() {
return <div>Test {calc()}</div>;
export const solidExample = async () =>
valle_tmp_35951592102522596577168527545545
@janpaul123
// This val responds to HTTP requests with an HTML page containing a colorful gradient background
HTTP
// This val responds to HTTP requests with an HTML page containing a colorful gradient background
export default async function main(req: Request): Promise<Response> {
const html = `
<html>
hotShotCafeWebsite
@francisnkotanyi
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import React from "https://esm.sh/react@18.2.0";
function App() {
return (
</div>
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(
chorus_get_all_data
@hyperglitch
An interactive, runnable TypeScript val by hyperglitch
Script
import { chorus_stored_data } from "https://esm.town/v/hyperglitch/chorus_stored_data";
import process from "node:process";
export async function chorus_get_all_data(auth, cached) {
// check auth
if (auth != process.env.chorus_access) {
stiffCoffeeLamprey
@maxm
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( {
JokeGeneratorReal
@anoushkaabroal
// Fetches a random joke.
Script
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",
archivoTwitterMilei
@nulo
An interactive, runnable TypeScript val by nulo
Cron
const ARCHIVO_API_TOKEN = Deno.env.get("ARCHIVO_API_TOKEN");
async function fetchLatestTweetUrls(): Promise<string[]> {
const response = await fetch(TWEETS_URL);
).filter(Boolean).slice(0, 500);
async function checkIfCrawled(url: string): Promise<boolean> {
const response = await fetch(ARCHIVO_API_URL, {
return crawls.some((crawl: any) => crawl.urls.includes(url) && crawl.status !== "failed");
async function crawlUrls(urls: string[]): Promise<void> {
if (urls.length === 0) return;
if (!res.ok) throw new Error("status:" + res.statusCode);
export default async function(interval: Interval) {
console.log("Starting tweet URL crawl job");