Search
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(
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!");
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 {
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);
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;
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",
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" } });
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++) {
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¤t_weather=true",
// Extract the current temperature from the response
const currentTemperature = response.data.current_weather.temperature_2m;
return { temperature: currentTemperature };
aquaAnt
@tempguy
// Import Cheerio and CryptoJS from npm
Script
// Import Cheerio and CryptoJS from npm
class AnimeScraper {
constructor(url) {
this.url = url;
this.result = [];
this.results = {
sourceA: "",
sourceB: "",
sourceC: "",
sourceD: "",
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;
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",
dependency_graph
@rlesser
This is a deprecated URL for the Dependency Graph tool. Please go to https://www.val.town/v/rlesser/dependencygraph for the updated tool.
HTTP
_This is a deprecated URL for the Dependency Graph tool. Please go to https://www.val.town/v/rlesser/dependencygraph for the updated tool._
const app = new Hono();
const NEW_BASE_URL = "https://rlesser-dependencygraph.web.val.run";
// Redirect old routes
app.get("/", (c) => {
return new Response(null, { status: 301, headers: { Location: NEW_BASE_URL } });
app.get("/:author/:name", (c) => {
const author = c.req.param("author");
const name = c.req.param("name");
return new Response(null, { status: 301, headers: { Location: `${NEW_BASE_URL}/${author}/${name}` } });
aqi
@sina
An interactive, runnable TypeScript val by sina
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",
bookTheSperryChalet
@mattrw2
A val that emails you when the Sperry Chalet in Glacier National Park has open vacancies
Cron
A val that emails you when the Sperry Chalet in Glacier National Park has open vacancies
const datePattern = /\b[A-Za-z]{3}\s\d{1,2}\b/;
export default async function(interval: Interval) {
const response = await fetch("https://www.sperrychalet.com/vacancy_s.html");
const body = await response.text();
const $ = cheerio.load(body);
const table = $("#availability");
if (table.length === 0) return;
const availableDays = [];
const unavailableDays = [];