Search

Results include substring matches and semantically similar vals. Learn more
maxm avatar
wasmBlobHost
@maxm
WASM Binary Host https://maxm-wasmblobhost.web.val.run/ Where should you host your WASM blobs to use in vals? Host them here! Upload with curl: curl -X POST -H "Content-Type: application/wasm" \ --data-binary @main.wasm https://maxm-wasmBlobHost.web.val.run
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo?v=27";
import { blob } from "https://esm.town/v/std/blob?v=12";
import { createHash } from "node:crypto";
import base32Encode from "npm:base32-encode";
import { renderToString } from "npm:react-dom/server";
const { author, name } = extractValInfo(import.meta.url);
const WASM_BLOB_PREFIX = `${author}-${name}-wasm-wasm-blob-v1-`;
sarahxc avatar
slackScout
@sarahxc
Slack scout sends a slack notification every time your keywords are mentioned on Twitter, Hacker News, or Reddit. Get notified whenever you, your company, or topics of interest are mentioned online. Built with Browserbase . Inspired by f5bot.com . Full code tutorial . Getting Started To run Slack Scout, you’ll need a Browserbase API key Slack Webhook URL: setup here Twitter Developer API key Browserbase Browserbase is a developer platform to run, manage, and monitor headless browsers at scale. We’ll use Browserbase to navigate to, and scrape our different news sources. We’ll also use Browserbase’s Proxies to ensure we simulate authentic user interactions across multiple browser sessions . Get started with Browserbase for free here . Twitter We’ve decided to use the Twitter API to include Twitter post results. It costs $100 / month to have a Basic Twitter Developer account. If you decide to use Browserbase, we can lend our token. Comment below for access. Once you have the SLACK_WEBHOOK_URL , BROWSERBASE_API_KEY , and TWITTER_BEARER_TOKEN , input all of these as Val Town Environment Variables . Project created by Sarah Chieng and Alex Phan 💌
Cron
### Browserbase
e’s Proxies](https://docs.browserbase.com/features/stealth-mode#proxies-and-residential-ips) to ensure we simulate authentic
Get started with Browserbase for free [here](https://www.browserbase.com/sign-up).
pomdtr avatar
getValTownTrpc
@pomdtr
// Forked from @easrng.getValTownTrpc
Script
export const getValTownTrpc = (async () => {
const { httpLink, createTRPCProxyClient } = await import("npm:@trpc/client");
return createTRPCProxyClient({
links: [
httpLink({
stevekrouse avatar
chatGPTPlugin
@stevekrouse
ChatGPT Plugin for Val Town Run code on Val Town from ChatGPT. Usage I haven't been able to get it to do very useful things yet. It certainly can evaluate simple JS code: It would be awesome if it knew how to use other APIs and make fetch calls to them, but it has been failing at that . Limitations This plugin currently only has unauthenticated access to POST /v1/eval, which basically means that all it can do is evaluate JavaScript or TypeScript. In theory it could refer to any existing vals in Val Town, but it wouldn't know about those unless you told it. Future directions Once we have more robust APIs to search for existing vals, this plugin could be WAY more valuable! In theory GPT4 could first search for vals to do a certain task and then if it finds one it could then write code based on that val. In practice however, that might require too many steps for poor GPT. We might need to use some sort of agent or langchain thing if we wanted that sort of behavior. Adding authentication could also enable it to make requests using your secrets and private vals and create new vals for you. However I am dubious that this would actually be practically useful. Installation Select GPT-4 (requires ChatGPT Plus) Click No plugins enabled Click "Install an unverified plugin" or "Develop your own plugin" (I'm not sure the difference) Paste in this val's express endpoint https://stevekrouse-chatGPTPlugin.express.val.run Click through the prompts until it's installed
Express
"description_for_model": `Val Town is a social programming environment.
Vals are JavaScript & TypeScript code.
They run server-side on Deno.
\`fetch\` is in the environment to access any PUBLIC real-time APIs or data feeds.
Answer any questions about times after your cut off date by querying PUBLIC APIs.
pomdtr avatar
testVtClient
@pomdtr
An interactive, runnable TypeScript val by pomdtr
Script
export const testVtClient = (async () => {
const { createApiClient } = await import(
"https://esm.sh/valtown-zod-client@0.0.7"
const apiClient = createApiClient("https://api.val.town");
const params = {
params: { username: "nbbaier", val_name: "hello" },
return apiClient.getV1aliasUsernameVal_name(params);
yawnxyz avatar
hnCloneOAuth
@yawnxyz
An interactive, runnable TypeScript val by yawnxyz
Script
case 'github':
this.oauthServices.github = new GitHub(config.clientId, config.clientSecret);
break;
case 'google':
this.oauthServices.google = new Google(config.clientId, config.clientSecret, config.redirectUri);
break;
// OAuth routes
for (const [service, oauthClient] of Object.entries(this.oauthServices)) {
app.get(`/auth/${service}`, async (c) => {
console.log(`Redirect URI for ${service}:`, `[${this.config.services[service].redirectUri}]`);
const url = await oauthClient.createAuthorizationURL(state, codeVerifier, {
scopes: ["profile", "email"]
try {
const tokens = await oauthClient.validateAuthorizationCode(code, codeVerifier);
const userInfoResponse = await fetch(this.config.services[service].userInfoUrl, {
pomdtr avatar
status
@pomdtr
Uptime Status Page This is the status page for the data generated by this uptime cron: @stevekrouse/uptime
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
import { html } from "https://esm.town/v/stevekrouse/html";
import { SparklineSVG } from "https://esm.town/v/stevekrouse/sparklineSVGReact";
import { renderToString } from "npm:react-dom/server";
function StatusRow({ rows }) {
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:
jxnblk avatar
useTypewriter
@jxnblk
// React hook for creating a typewriter effect
Script
// React hook for creating a typewriter effect
/** @jsxImportSource https://esm.sh/react */
import { useEffect, useRef, useState } from "https://esm.sh/react";
const rand = (min, max) => Math.floor(Math.random() * (max - min) + min);
isidentical avatar
emeraldCrocodile
@isidentical
An interactive, runnable TypeScript val by isidentical
Script
import * as fal from "npm:@fal-ai/serverless-client";
fal.config({
// Can also be auto-configured using environment variables:
roadlabs avatar
codingcanvas
@roadlabs
VALL-E-DRAW LLM code generation for vals, on a canvas! Make apps with a frontend, backend, and database. First you need a working version of VALL-E. Follow the steps here . Fork this val, and update the iframeSrc to point to your working version of VALL-E. Type text prompts, select it, press "Q". Select a previous generation with a new text prompt to keep iterating. Selecting shapes doesn't work yet. Have fun!
HTTP
import valledrawclient from "https://esm.town/v/janpaul123/valledrawclient";
export default valledrawclient({
iframeSrc: "https://roadlabs-myvalle.web.val.run",
stevekrouse avatar
subaudio
@stevekrouse
sub.audio – generate subtitles and chapters for any audio URL. Speech-to-text and chapter summaries powered by Substrate 🪩 To fork, sign up for Substrate to get your own API key and $50 free credits
HTTP (deprecated)
display: none;
.side-chapter {
opacity: 0.5;
id="prev-chapter-title"
class="chapter-title-txt side-chapter"
></div>
id="next-chapter-title"
class="chapter-title-txt side-chapter"
></div>
nico avatar
whatIsMyIp
@nico
I wanted to see if val.town forwards my client IP Address using the x-forwarded-for header, which it does, but cloudflare provides the True-Client-IP header as well. When you run a val on the website, it is actually running from val's servers so it won't come from your client IP. You'll need to copy the express fetch and run that from your client.
Express
I wanted to see if val.town forwards my client IP Address using the x-forwarded-for header, which it does, but cloudflare pro
export let whatIsMyIp = (req: express.Request, res: express.Response) => {
const xForwardedFor = req.get("x-forwarded-for");
const ip = req.get("True-Client-IP");
res.json({
ip,
karfau avatar
chai
@karfau
// @deno-types="https://unpkg.com/@types/chai/index.d.ts"
Script
// and importing the javascript file this way works
} = chai;
// by reexporting everythin (beside `should` since it doesn't work with ESM) types work in other vals
export { assert, Assertion, AssertionError, config, expect, use, util, version };
stevekrouse avatar
exponentialBackoffMiddleware
@stevekrouse
Exponential backoff middleware If your server returns a 5xx error, it will wait 1, 2, 4, 8, 16, 32, 64, 128... seconds before retrying Usage import { exponentialBackoffMiddleware } from "https://esm.town/v/stevekrouse/exponentialBackoffMiddleware" export default exponentialBackoffMiddleware(() => { /* your normal http handler * / }) Example usage: https://www.val.town/v/stevekrouse/BIGweather?v=164#L114
Script
/** @jsxImportSource npm:preact */
import { render } from "npm:preact-render-to-string";
* Exponential backoff middleware
* If your server returns a 5xx error,