Search

Results include substring matches and semantically similar vals. Learn more
justinenerio avatar
scarletClam
@justinenerio
An interactive, runnable TypeScript val by justinenerio
HTTP
export default async function (req: Request): Promise<Response> {
return Response.json({ ok: true, msg: 'saba jah allergic kag air'})
janpaul123 avatar
valle_tmp_0028705057670890266002206804567040699
@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(req: Request): Promise<Response> {
return new Response("Hello world");
janpaul123 avatar
valle_tmp_187519111800805945311738641630043
@janpaul123
// This val will respond to HTTP requests with a simple "Hello, World!" message
HTTP
// This val will respond to HTTP requests with a simple "Hello, World!" message
export default async function main(req: Request): Promise<Response> {
return new Response("Hello, World!", {
headers: { "Content-Type": "text/plain" },
janpaul123 avatar
valle_tmp_328943385696169433338095012957367
@janpaul123
// This val responds with "Hello, World!" to all incoming requests
HTTP
// This val responds with "Hello, World!" to all incoming requests
export default async function main(req: Request): Promise<Response> {
return new Response("Hello, World!");
u avatar
refresher_fetcher
@u
An interactive, runnable TypeScript val by u
Cron
export async function refresher_fetcher() {
for (const [name, time] of Object.entries(
refreshData as Record<string, number>
const hrsPassed = (Date.now() - time) / msPerHour;
if (hrsPassed > 2) {
await alert(
name,
`⚠️⚠️NO PING IN 2hr from ${name}, it's been ${stat(
name
)} mins!⚠️⚠️`
kylem avatar
dependencyLicenses
@kylem
Dependency License Checker Enter a raw github URL to a package.json, https://raw.githubusercontent.com/username/repo/branch/package.json and get a table of license types for all your dependencies. A fork of gitReleaseNotes
HTTP
# Dependency License Checker
Enter a raw github URL to a package.json,
https://raw.githubusercontent.com/username/repo/branch/package.json
and get a table of license types for all your dependencies.
*A fork of [gitReleaseNotes](https://www.val.town/v/kylem/gitReleaseNotes)*
/** @jsxImportSource npm:hono@3/jsx */
interface PackageJson {
dependencies?: Record<string, string>;
devDependencies?: Record<string, string>;
interface PackageLicense {
pomdtr avatar
favicon
@pomdtr
Favicons <link rel="icon" href="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/e8532b85-8de0-40f5-47a1-d4b9580ff200/public" media="(prefers-color-scheme: light)" /> <link rel="icon" href="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/f774eb95-7207-43bf-3a6b-a9a423d9bb00/public" media="(prefers-color-scheme: dark)" />
HTTP
# Favicons
![light.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/e8532b85-8de0-40f5-47a1-d4b9580ff200/public)
```html
<link
rel="icon"
href="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/e8532b85-8de0-40f5-47a1-d4b9580ff200/public"
export default function(req) {
const url = new URL(req.url);
if (url.pathname == "/val-town") {
return Response.redirect(
stevekrouse avatar
yellowSpider
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
Script
import { jsPython } from "npm:jspython-interpreter";
const interpreter = jsPython()
.addFunction("fetch", fetch);
const script = `
print(fetch("https://datasette.simonwillison.net/simonwillisonblog/blog_quotation.json?_labels=on&_shape=objects").text())
await interpreter.evaluate(script);
jamiedubs avatar
runGlif
@jamiedubs
glif API mini-SDK make generative magical AI things set your GLIF_API_TOKEN in your own ENV, or you'll hit rate limits: https://glif.app/settings/api-tokens call from your val like: import { runGlif } from "https://esm.town/v/jamiedubs/runGlif"; const json = await runGlif({ id: "cluu91eda000cv8jd675qsrby", inputs: ["hello", "world"] }); console.log(json);
Script
glif API mini-SDK
make generative magical AI things
set your `GLIF_API_TOKEN` in your own ENV, or you'll hit rate limits: https://glif.app/settings/api-tokens
call from your val like:
```ts
const json = await runGlif({ id: "cluu91eda000cv8jd675qsrby", inputs: ["hello", "world"] });
export interface RunGlifResponse {
id?: string;
inputs?: string[];
error?: string;
willthereader avatar
BrowserbaseFetcherFromURL
@willthereader
// 1st stable version is v13
HTTP
// 1st stable version is v13
const BROWSERBASE_API_KEY = Deno.env.get("BROWSERBASE_API_KEY");
const TIMEOUT = 30000; // 30 seconds timeout
export default async function server(request: Request): Promise<Response> {
// Array of URLs to scrape
const urls = [
"https://forums.spacebattles.com/threads/rwby-rwby-snippets-and-plot-bunnies.1144561/#post-98868103",
"https://forums.spacebattles.com/threads/rwby-rwby-snippets-and-plot-bunnies.1144561/page-2#post-99060176",
"https://forums.spacebattles.com/threads/rwby-rwby-snippets-and-plot-bunnies.1144561/page-256#post-104724970",
"https://forums.spacebattles.com/threads/rwby-rwby-snippets-and-plot-bunnies.1144561/page-134#post-102044850",
janpaul123 avatar
valle_tmp_4630203169811349044369672658961
@janpaul123
// This val responds with "Hello, World!" on every HTTP request
HTTP
// This val responds with "Hello, World!" on every HTTP request
export default async function main(req: Request): Promise<Response> {
return new Response("Hello, World!", { headers: { "Content-Type": "text/plain" } });
janpaul123 avatar
valwriter_output
@janpaul123
// This approach fetches weather data for Brooklyn, NY from the Open Meteo API
Script
// This approach fetches weather data for Brooklyn, NY from the Open Meteo API
// It then parses the response to extract the current temperature
import axios from "npm:axios@0.21.1";
export default async function main() {
// Fetch weather data for Brooklyn, NY
const response = await axios.get(
"https://api.open-meteo.com/v1/forecast?latitude=40.6782&longitude=-73.9442&hourly=temperature_2m&current_weather=true",
// Extract the current temperature from the response
const currentTemperature = response.data.current_weather.temperature_2m;
return { temperature: currentTemperature };
dhvanil avatar
val_zfIPxdNj1i
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export default async function handler(req) {
try {
const result = await (async () => {
function isPrime(num) {
if (num <= 1) return false;
for (let i = 2; i <= Math.sqrt(num); i++) {
if (num % i === 0) return false;
return true;
function findLowestThreeDigitPrime() {
for (let num = 100; num < 1000; num++) {
stevedylandev avatar
twemoji
@stevedylandev
* modified version of https://unpkg.com/twemoji@13.1.0/dist/twemoji.esm.js.
Script
* modified version of https://unpkg.com/twemoji@13.1.0/dist/twemoji.esm.js.
/* ! Copyright Twitter Inc. and other contributors. Licensed under MIT */
// this file added in: https://github.com/open-sauced/opengraph/issues/50
const U200D = String.fromCharCode(8205);
const UFE0Fg = /\uFE0F/g;
export function getIconCode (char: string) {
return toCodePoint(!char.includes(U200D) ? char.replace(UFE0Fg, "") : char);
function toCodePoint (unicodeSurrogates: string) {
const r = [];
let c = 0;
davidmchan avatar
updateCoffee
@davidmchan
An interactive, runnable TypeScript val by davidmchan
Script
export const updateCoffee = async (req: express.Request, res: express.Response) => {
let data = req.query.type;
const d = new Date();
const marked = await import("npm:marked");
if (
data != coffee.last_update ||
d.getTime() - coffee.last_update_time > (5 * 60 * 1000)
coffee.last_update_time = d.getTime();
coffee.last_update_str = d.toLocaleString("en-US", {
timeZone: "America/Los_Angeles",