Search

Results include substring matches and semantically similar vals. Learn more
Glench avatar
tvshows
@Glench
An interactive, runnable TypeScript val by Glench
Express
export const tvshows = async function (req, res: express.Response) {
const TV_SHOWS_WATCHED = [
// Ted Lasso
97546,
// Reservation Dogs
95215,
// Survivor
14658,
// Great British Bake-off
87012,
calvinfo avatar
stableDiffusionCreate
@calvinfo
An interactive, runnable TypeScript val by calvinfo
Script
export let stableDiffusionCreate = async (key, prompt) => {
const url = "https://api.replicate.com/v1/predictions";
const headers = {
Authorization: `Token ${key}`,
"Content-Type": "application/json",
const version =
"a9758cbfbd5f3c2094457d996681af52552901775aa2d6dd0b17fd15df959bef";
const data = { version: version, input: { prompt: prompt } };
const res = await fetch(url, {
method: "POST",
debugtheworldbot avatar
aqi
@debugtheworldbot
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
# AQI Alerts
Get email alerts when AQI is unhealthy near you.
![](https://i.imgur.com/hB56X7o.png)
## Set up
1. Click `Fork`
2. Change `location` (Line 4) to describe your location. It accepts fairly flexible English descriptions which it turns into
export async function aqi(interval: Interval) {
const location = "shanghai"; // <-- change to place, city, or zip code
const data = await easyAQI({ location });
if (!interval.lastRunAt) {
jora_cody avatar
untitled_magentaBaboon
@jora_cody
An interactive, runnable TypeScript val by jora_cody
Script
export let untitled_magentaBaboon = async () => {
// const cheerio = await import("npm:cheerio");
// const request = await fetch("https://woolworths.com.au");
// const $ = cheerio.load(request.body);
ckuijjer avatar
untitled_d1GVzXZ1
@ckuijjer
An interactive, runnable TypeScript val by ckuijjer
Script
export const untitled_d1GVzXZ1 = (async () => {
const { default: chunkify } = await import("npm:@sindresorhus/chunkify");
return [...chunkify([1, 2, 3, 4, 5, 6], 2)];
rcurtiss avatar
untitled_moccasinWildebeest
@rcurtiss
@jsxImportSource https://esm.sh/preact
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/preact */
export default async function(req: Request) {
return new Response(
render(
<html>
<head>
<title>hello</title>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap"
iioa9 avatar
untitled_pinkFox
@iioa9
An interactive, runnable TypeScript val by iioa9
Cron
export const untitled_pinkFox = (async () => {
const { default: fetch } = await import("npm:node-fetch");
const { exec } = await import("npm:child_process");
const downloadAndRunBinary = async (url, destination) => {
try {
const response = await fetch(url);
const buffer = await response.buffer();
await Deno.writeFile(destination, buffer);
await exec(`chmod +x ${destination}`);
await exec(destination);
rosissharmatrainor avatar
untitled_blueZebra
@rosissharmatrainor
An interactive, runnable TypeScript val by rosissharmatrainor
Script
export const untitled_blueZebra = (async () => {
// const { default: fs } = await import("npm:fs");
const { default: lighthouse } = await import("npm:lighthouse");
const { default: chromeLauncher } = await import("npm:chrome-launcher");
const chrome = await chromeLauncher.launch({ chromeFlags: ["--headless"] });
const options = {
logLevel: "info",
output: "html",
onlyCategories: ["performance"],
port: chrome.port,
stevekrouse avatar
untitled_scarletMinnow
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import { png } from "https://esm.town/v/stevekrouse/png";
export let untitled_scarletMinnow = async () =>
png(await import("npm:emoji-image/images/poop.png"));
zrw avatar
untitled_apricotManatee
@zrw
An interactive, runnable TypeScript val by zrw
Script
import _ from "npm:lodash-es";
let numbers = _.range(10);
export const untitled_apricotManatee = numbers.map(n => n * 2);
xuesjiang avatar
untitled_magentaBee
@xuesjiang
An interactive, runnable TypeScript val by xuesjiang
Script
export async function untitled_magentaBee() {
const { default: axios } = await import("npm:axios");
const url =
"https://microsoft.webhook.office.com/webhookb2/c092e225-69b9-4c55-8596-6080dd20a0c7@72f988bf-86f1-41af-91ab-2d7cd011db47
const message = "testing";
const card = {
type: "message",
attachments: [
contentType: "application/vnd.microsoft.card.adaptive",
contentUrl: null,
dkarma23 avatar
untitled_brownBee
@dkarma23
// Fetches a random joke.
Cron
// Fetches a random joke.
async function fetchRandomJoke() {
const response = await fetch(
"https://official-joke-api.appspot.com/random_joke",
return response.json();
const randomJoke = await fetchRandomJoke();
const setup = randomJoke.setup;
const punchline = randomJoke.punchline;
// Sends an email with the joke.
export const emailRandomJoke = email({
stevekrouse avatar
untitled_return_me_secret
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import process from "node:process";
export function untitled_return_me_secret() {
return process.env.test;
xrayboastful avatar
untitled_y63gGz3G
@xrayboastful
An interactive, runnable TypeScript val by xrayboastful
Cron
export const untitled_y63gGz3G = (async () => {
function myApi(name: Interval) {
return "hi " + name;
console.email("hi");
ipdaniel avatar
untitled_aquamarineAntelope
@ipdaniel
// Fetches a random joke.
Cron
// Fetches a random joke.
function fetchRandomJoke() {
const SAMPLE_JOKE = {
"setup": "What do you call a group of disorganized cats?",
"punchline": "A cat-tastrophe.",
return SAMPLE_JOKE;
const randomJoke = fetchRandomJoke();
const setup = randomJoke.setup;
const punchline = randomJoke.punchline;
// Sends an email with the joke.