Search

Results include substring matches and semantically similar vals. Learn more
ari avatar
aqi
@ari
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
import { email } from "https://esm.town/v/std/email?v=9";
import { easyAQI } from "https://esm.town/v/stevekrouse/easyAQI?v=5";
export async function aqi(interval: Interval) {
const location = "waterford connecticut"; // <-- change to place, city, or zip code
const data = await easyAQI({ location });
robsimmons avatar
aoc_2023_11_practical
@robsimmons
An interactive, runnable TypeScript val by robsimmons
Script
starAt (remap x X) (remap y Y) :-
charAt X Y is "#".
function bigabs(x) {
return x < 0 ? -x : x;
for (const expansionFactor of [2, 10, 100, 1000000]) {
MichaelNollox avatar
VALLE
@MichaelNollox
VALL-E LLM code generation for vals! Make apps with a frontend, backend, and database. It's a bit of work to get this running, but it's worth it. Fork this val to your own profile. Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in tempValsParentFolderId . If you want to use OpenAI models you need to set the OPENAI_API_KEY env var . If you want to use Anthropic models you need to set the ANTHROPIC_API_KEY env var . Create a Val Town API token , open the browser preview of this val, and use the API token as the password to log in.
HTTP
* Make a folder for the temporary vals that get generated, take the ID from the URL, and put it in `tempValsParentFolderId`.
* If you want to use OpenAI models you need to set the `OPENAI_API_KEY` [env var](https://www.val.town/settings/environment-v
* If you want to use Anthropic models you need to set the `ANTHROPIC_API_KEY` [env var](https://www.val.town/settings/environ
text: string;
timestamp: number;
export default async function main(req: Request): Promise<Response> {
if (req.method === "GET") {
// Retrieve and return all comments
kylem avatar
gitReleaseNotes
@kylem
Github Release Notes from package.json Enter a raw github URL to a package.json, https://raw.githubusercontent.com/username/repo/branch/package.json and get a response of all release notes for all packages from current to latest. Roadmap [ ] GenAI summary [ ] Weekly cron email reports [ ] Send update PRs [ ] Other package managers like PyPi [ ] Formatting/styling [ ] Loading spinner
HTTP
// Function to fetch package info from NPM registry
async function fetchPackageInfo(packageName: string) {
// Function to extract GitHub repo URL from package info
function extractGitHubRepoUrl(packageInfo: any): string | null {
// Function to get the GitHub repository path (owner/repo) from the URL
function getGithubRepoPath(repoUrl: string): string | null {
async function getGithubReleases(repo: string): Promise<GithubRelease[]> {
function compareVersions(version1: string, version2: string): number {
async function getReleaseNotesBetweenVersions(repo: string, currentVersion: string): Promise<GithubRelease[]> {
async function checkNpmUpdates(packageJsonUrl: string): Promise<string> {
serna avatar
retThis
@serna
An interactive, runnable TypeScript val by serna
Script
import { retThat } from "https://esm.town/v/serna/retThat";
export async function retThis() {
return await retThat();
mdalam7294 avatar
succinctCyanLungfish
@mdalam7294
@jsxImportSource https://esm.sh/react@18.2.0
HTTP
import React, { useState } from "https://esm.sh/react@18.2.0";
function WebsiteRanker() {
const [url, setUrl] = useState("");
</div>
function client() {
createRoot(document.getElementById("root")).render(<WebsiteRanker />);
if (typeof document !== "undefined") { client(); }
export default async function server(request: Request): Promise<Response> {
if (request.method === "POST" && new URL(request.url).pathname === "/rank") {
deepmojo avatar
efficientWhiteBobolink
@deepmojo
@jsxImportSource https://esm.sh/react
HTTP
import React, { useState, useEffect } from "https://esm.sh/react@18.2.0";
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
function App() {
const [domain, setDomain] = useState("");
const [crawlResults, setCrawlResults] = useState(null);
const root = createRoot(rootElement);
root.render(React.createElement(React.StrictMode, null, React.createElement(App)));
export default async function server(req: Request): Promise<Response> {
const url = new URL(req.url);
if (req.method === "POST" && url.pathname === "/api") {
eagle251 avatar
tanaCalculator
@eagle251
An interactive, runnable TypeScript val by eagle251
Script
import { calculator as calculator2 } from "https://esm.town/v/eagle251/calculator";
export async function tanaCalculator(res, req) {
let operation = `${req.query.operation}`;
let number1 = `${req.query.number1}`;
brettsmith avatar
jsPython
@brettsmith
An interactive, runnable TypeScript val by brettsmith
Script
const { jsPython } = await import("npm:jspython-interpreter");
const script = `
def mapFunction(r, i):
v = r * i
return v
x = [1, 2, 3, 4]
x
.map(mapFunction)
.filter(r => r * r)
.join(",")
yawnxyz avatar
nighthawks
@yawnxyz
This is nighthawks an experimental NPC character generator that remembers details about conversations. Import this into other workflows for now; a UI is coming soon!
Script
const characterModel = new ModelProvider({
id: `${characterName}`,
// for web search / tool use, use openai
provider: 'openai',
model: 'gpt-4o',
// provider: 'groq',
stevekrouse avatar
vtOpenAPI
@stevekrouse
// set at Thu May 02 2024 18:00:24 GMT+0000 (Coordinated Universal Time)
Script
// set at Thu May 02 2024 18:00:24 GMT+0000 (Coordinated Universal Time)
evaluate JavaScript and TypeScript expressions, run vals as APIs, either as functions or Express handlers.\n\n Learn more
janpaul123 avatar
valle_tmp_58361579707729794716271798593166
@janpaul123
// This val responds to HTTP requests with an HTML page displaying "Hello, world!" with a crazy gradient background
HTTP
// This val responds to HTTP requests with an HTML page displaying "Hello, world!" with a crazy gradient background
export default async function main(req: Request): Promise<Response> {
const html = `
<!DOCTYPE html>
satvikrepaka avatar
coffeeHaddock
@satvikrepaka
// 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",
dhvanil avatar
val_lMsx7C9XfR
@dhvanil
An interactive, runnable TypeScript val by dhvanil
Script
export default async function handler(req) {
try {
const result = await (async () => {
dhvanil avatar
val_mS5KlAywrl
@dhvanil
An interactive, runnable TypeScript val by dhvanil
HTTP
export default async function handler(req) {
try {
const result = await (async () => {