Public vals
779
stevekrouse avatar
stevekrouse
exampleNanoId
Script
An interactive, runnable TypeScript val by stevekrouse
0
stevekrouse avatar
stevekrouse
nanoid
Script
Nano Id Function Usage @stevekrouse.nanoid() // Returns something like "MRRdswxjEph4sDiuEzlBM" Example: https://www.val.town/v/stevekrouse.exampleNanoId
0
stevekrouse avatar
stevekrouse
telegramValTownBotWebhookSetup
Script
An interactive, runnable TypeScript val by stevekrouse
0
stevekrouse avatar
stevekrouse
telegramValTownBotWebhook
HTTP
The beating heart of the @ValTownBot on Telegram: https://www.val.town/v/stevekrouse.telegram
0
stevekrouse avatar
stevekrouse
spaceJoin
Script
An interactive, runnable TypeScript val by stevekrouse
0
stevekrouse avatar
stevekrouse
resend
Script
Send an email via resend Requires a resend API key, which you can get for free. Usage @stevekrouse.resend({ from: "onboarding@resend.dev", to: "steve@val.town", subject: "Hello World", html: "Congrats on sending your first email!", apiKey: @stevekrouse.secrets.resend, });
0
stevekrouse avatar
stevekrouse
openai
Script
OpenAI ChatGPT helper function This val uses your OpenAI token if you have one, and the @std/openai if not, so it provides limited OpenAI usage for free. import { chat } from "https://esm.town/v/stevekrouse/openai"; const { content } = await chat("Hello, GPT!"); console.log(content); import { chat } from "https://esm.town/v/stevekrouse/openai"; const { content } = await chat( [ { role: "system", content: "You are Alan Kay" }, { role: "user", content: "What is the real computer revolution?"} ], { max_tokens: 50, model: "gpt-4o" } ); console.log(content);
1
stevekrouse avatar
stevekrouse
untitled_amberChinchilla
Script
An interactive, runnable TypeScript val by stevekrouse
0
stevekrouse avatar
stevekrouse
rlimit
Script
An interactive, runnable TypeScript val by stevekrouse
0
stevekrouse avatar
stevekrouse
devNull
Script
Dev Null A JS function and API inspired by /dev/null that will throw away whatever you send it and return null . Function usage @stevekrouse.devNull("useless data") API Usage https://api.val.town/v1/run/stevekrouse.devNull?args=[%22useless%20data%22] Why? Honestly I don't know why you'd use this function. I just made it as a joke to link to it from @stevekrouse.dm . I guess you could also use it a joke to send data you want to call attention to the fact that you very much don't care about it, ie I really don't care about the price of bitcoin: @stevekrouse.devNull(await @stevekrouse.currency("usd", "btc"))
0
stevekrouse avatar
stevekrouse
dm
Script
DM Me! Ever wanted to message someone about their val but you couldn't find their contact info? Want to allow folks on Val Town to contact you without exposing your email address? Boy do I have the over-engineered solution for you! This is a userspace, authenticated protocol for Val Town direct messages. Protocol Expose a dm function on your namespace that that accepts messages and some authentication data (described below). The easiest way to accomplish this is to fork this val. What you choose to do with direct messages is totally up to you. At the moment, I email myself your message and save it to a private array val. You could forward it along to yourself some other way, batch up messages to get a daily summary email if you're Mr. Popular, or send them to /dev/null if you're Mr. Antisocial. Authentication This protocol uses my Val Town public key auth scheme , so you'll need to follow the first two steps of that blog post – (1) generate a keypair and (2) publish your public key – to authenticate to this function. Usage You can call this function via the @stevekrouse.runValAPIAuth helper: @stevekrouse.runValAPIAuth({ val: "@stevekrouse.dm", args: ["hi steve!"], keys: @me.exportedKeys, }); Example: https://www.val.town/v/stevekrouseTest.untitled_tealMinnow
0
stevekrouse avatar
stevekrouse
jsJamHTML
Script
An interactive, runnable TypeScript val by stevekrouse
0
stevekrouse avatar
stevekrouse
twitterJSJamSearch
Script
An interactive, runnable TypeScript val by stevekrouse
0
stevekrouse avatar
stevekrouse
untitled_whiteWorm
Script
An interactive, runnable TypeScript val by stevekrouse
0
stevekrouse avatar
stevekrouse
newJSJamMessage
Script
An interactive, runnable TypeScript val by stevekrouse
0
stevekrouse avatar
stevekrouse
jsJamMessages
Script
// set by stevekrouse.newJSJamMessage at 2023-07-11T18:35:51.228Z
0