Search

Results include substring matches and semantically similar vals. Learn more
tmcw avatar
underscoreExample
@tmcw
underscore underscore is a module for functional programming and other utilities in JavaScript. It inspired lodash , which is what most people use now, because lodash is both faster, and provides an ESM version which is convenient to use in Val Town. Note that while we can import from lodash-es and use its named exports, underscore only provides a default export, so that's why we have the code { default: _ } below.
Script
# underscore
[underscore](https://underscorejs.org/) is a module for functional programming and other utilities in JavaScript. It inspired
Note that while we can import from `lodash-es` and use its named exports, `underscore` only provides a default export, so tha
export let underscoreExample = (async () => {
const { default: _ } = await import("npm:underscore");
return _.max([1, 2, 3]);
pdebie avatar
fetchRss
@pdebie
This is an RSS parser val, similar to @stevekrouse.fetchRSS, but uses an NPM parsing library so it can support multiple RSS feed types easily.
Script
This is an RSS parser val, similar to @stevekrouse.fetchRSS, but uses an NPM parsing library
so it can support multiple RSS feed types easily.
// This supports more RSS types than @stevekrouse.fetchRSS
export async function fetchRss(url: string, lastRunDate?: string | number) {
let Parser = await import("npm:rss-parser");
let parser = new Parser.default();
let response = await fetch(url);
let data = await response.text();
let { items } = await parser.parseString(data);
if (lastRunDate) {
taras avatar
scrape2md
@taras
This is a deno/valtown port in progress of https://github.com/tarasglek/scrape2md License: MIT Handy script to scrape various data sources into markdown. Intended to feed llms in https://chatcraft.org Usage: https://taras-scrape2md.web.val.run/ + URL_TO_SCRAPE Or just visit in browser and paste your url TODO https://chatcraft.org/api/share/tarasglek/IDYChVAilfePgVZb_T5pH POST from browser https://www.val.town/v/nbbaier/valToGH sync to github Metadata for use with https://github.com/tarasglek/valtown2js: { "typeCheck": false, "mappings": { "https://esm.sh/linkedom": { "name": "linkedom", "version": "^0.16.8" } }, "package": { "name": "scrape2md", "version": "1.0.0", "devDependencies": { "@types/turndown": "^5.0.4" } } }
HTTP (deprecated)
This is a deno/valtown port in progress of https://github.com/tarasglek/scrape2md
License: MIT
Handy script to scrape various data sources into markdown. Intended to feed llms in https://chatcraft.org
Usage:
https://taras-scrape2md.web.val.run/ + URL_TO_SCRAPE
Or just visit in browser and paste your url
function getYoutubeVideoID(url: URL): string | null {
const regExp = /(?:youtube\.com\/(?:[^/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/\s]{11})/i;
const match = url.href.match(regExp);
return match ? match[1] : null;
alana avatar
myspace
@alana
Create your own Myspace profile, deployed to Val town. https://jdan-myspace.web.val.run Click "..." and select Fork to create your own. From there you can: Customize your own profile Or post on my wall by appending to messages and sending me a pull request
HTTP (deprecated)
Create your own Myspace profile, deployed to Val town. https://jdan-myspace.web.val.run
![Screenshot 2024-04-27 at 7.20.32 PM.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/cd8881fd-a0ab-4687-1da1-21f4cdcaa
Click "..." and select Fork to create your own.
![Screenshot 2024-04-27 at 7.18.00 PM.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/102d5f8f-0f9e-4351-c654-b3540a660
From there you can:
* Customize your own profile
// TODO: Fetch from key-value
const profile = {
displayName: "Jordan",
seo: {
pomdtr avatar
cmdk
@pomdtr
An interactive, runnable TypeScript val by pomdtr
HTTP (deprecated)
import { createApp } from "jsr:@pomdtr/val-town-cmdk@0.0.2";
const app = createApp(Deno.env.get("valtown"));
export default app.fetch;
stevekrouse avatar
purpleMagpie
@stevekrouse
An interactive, runnable TypeScript val by stevekrouse
HTTP (deprecated)
import { httpClient } from "https://esm.town/v/pomdtr/http_client";
export default httpClient((req) => {
return new Response("Hello World!");
bookmarks: [
"label": "Dummy Request",
"request": new Request("https://dummyjson.com/products"),
path: "/",
moe avatar
responses
@moe
An interactive, runnable TypeScript val by moe
Script
import { render } from "npm:preact-render-to-string";
export const htmlResponse = (html) =>
new Response(html, {
headers: {
"Content-Type": "text/html",
export const reactResponse = (component) => htmlResponse(render(component));
shane98c avatar
aqi
@shane98c
An interactive, runnable TypeScript val by shane98c
Cron
export let aqi = async () => {
let pm25 = (
await fetchJSON(
"https://api.openaq.org/v2/latest?" +
new URLSearchParams({
limit: "10",
page: "1",
location: "Saint Paul",
offset: "0",
sort: "desc",
stevekrouse avatar
translator
@stevekrouse
Press to talk, and get a translation! The app is set up so you can easily have a conversation between two people. The app will translate between the two selected languages, in each voice, as the speakers talk. Add your OpenAI API Key, and make sure to open in a separate window for Mic to work.
HTTP (deprecated)
Press to talk, and get a translation!
The app is set up so you can easily have a conversation between two people. The app will translate between the two selected l
Add your OpenAI API Key, and make sure to open in a separate window for Mic to work.
const app = new Hono();
const openai = new OpenAI(Deno.env.get("OPENAI_API_KEY_VOICE"));
class TranscriptionService {
async transcribeAudio(audioFile) {
try {
const transcription = await openai.audio.transcriptions.create({
file: audioFile,
isidentical avatar
falImageHandler
@isidentical
An interactive, runnable TypeScript val by isidentical
HTTP (deprecated)
import * as fal from "npm:@fal-ai/serverless-client";
fal.config({
// Can also be auto-configured using environment variables:
credentials: Deno.env.get("FAL_KEY"),
export default async function(req: Request): Promise<Response> {
const { prompt } = await req.json();
const result: any = await fal.run("fal-ai/fast-lightning-sdxl", { input: { prompt } });
return Response.json({ url: result.images[0].url });
daisuke avatar
linkInBioTemplate
@daisuke
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
export default async function(req: Request) {
return new Response(
renderToString(
<html>
<head>
<meta charSet="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>daisuke</title>
</head>
iamseeley avatar
reacttldrawclient
@iamseeley
@jsxImportSource https://esm.sh/react
Script
/** @jsxImportSource https://esm.sh/react **/
// Make sure to only import from esm.sh (npm: specifier are not supported in the browser)
function TestComponent() {
return <div>Test Component</div>;
export function App() {
const [isReady, setIsReady] = useState(false);
useEffect(() => {
setIsReady(true);
if (!isReady) {
return <div>Loading...</div>;
stevekrouse avatar
dateme_home_react
@stevekrouse
@jsxImportSource https://esm.sh/react@18.2.0
Script
/** @jsxImportSource https://esm.sh/react@18.2.0 */
async function getCurrentPosition(opts): Promise<GeolocationPosition> {
return new Promise((resolve, reject) => {
if (!navigator?.geolocation) {
return resolve(undefined);
} else {
navigator.geolocation.getCurrentPosition(resolve, reject, opts);
async function reverseGeocodeNominat(lat, lng) {
const url = `https://nominatim.openstreetmap.org/reverse?format=json&lat=${lat}&lon=${lng}&zoom=13`;
const response = await fetch(url);
willthereader avatar
animatedReadmeSVG
@willthereader
Fancy animated SVGs in readmes, along with centering and image sizing. <div align="center"><img width=200 src="https://gpanders.com/img/DEC_VT100_terminal.jpg"></div> <p align="center"> <img src="https://maxm-animatedreadmesvg.web.val.run/comet.svg" /> </p> <p align="center"> <img src="https://maxm-animatedreadmesvg.web.val.run/custom text!" /> </p>
HTTP (deprecated)
Fancy animated SVGs in readmes, along with centering and image sizing.
<div align="center"><img width=200 src="https://gpanders.com/img/DEC_VT100_terminal.jpg"></div>
<div align="center"><img width=200 src="https://gpanders.com/img/DEC_VT100_terminal.jpg"></div>
<p align="center">
<img src="https://maxm-animatedreadmesvg.web.val.run/comet.svg" />
</p>
/** @jsxImportSource https://esm.sh/react */
const genSVG = (request: Request): string => {
let pathname = new URL(request.url).pathname;
if (pathname === "/comet.svg") {
pomdtr avatar
blob_admin_create
@pomdtr
@jsxImportSource https://esm.sh/hono@4.0.8/jsx
Script
/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
const route = new Hono();
route.get("/", (c) => {
return c.render(
<form method="POST">
<label for="key">Key</label>
<input name="key" type="text" />
<label for="content">Content</label>
<textarea style="height: 60vh;" name="content" />
<input type="submit" value="Create" />