Trending Vals

31
iamseeley avatar
sendSMS
@iamseeley
Script
💬 Val Town Email-to-SMS Usage import { sendSMS } from 'https://esm.town/v/iamseeley/sendSMS'; sendSMS(phoneNumber: string, message: string, carrier: string): Promise<void> Parameters phoneNumber: The recipient's phone number (string of digits, no spaces or dashes) message: The text message you want to send carrier: The recipient's cell phone carrier. Supported carriers: 'att' (AT&T), 'tmobile' (T-Mobile), 'verizon' (Verizon), 'sprint' (Sprint) List of Email-To-SMS Addresses Comment on this val if you'd like me to add a carrier from the above list! Example import { sendSMS } from 'https://esm.town/v/iamseeley/sendSMS'; sendSMS('1234567890', 'Hello from Val Town!', 'verizon');
32
substrate avatar
websim
@substrate
HTTP
WebSim on Val with Substrate 🪩 To fork, sign up for Substrate to get your own API key and $50 free credits
33
edgeeffect avatar
whatDoYouThinkOfItSoFar
@edgeeffect
Cron
What Do You Think of it so far? Rubbish! Our bin men (garbage men to you) come round every Friday morning. But alternate weeks, they take either rubbish or recycling. This val extracts from our local council website which collection they're doing this week and E. mails me the details every Thursday afternoon. I've hidden the URL in an environment variable (sorry) but the URL has details of our address and I'm not sure how happy our local council would be to start getting loads of hits from all round the world. But it's here as a sample of how easy it is to scrape a website and E. mail the details to yourself. And, on that subject, can I just say "hats off to val.town", I've been looking for a little cloud host that will let me E. mail myself from a cron for absolutely ages.
34
maxm avatar
staticChess
@maxm
HTTP (preview)
Check it out here: https://chess.maxmcd.com Plain, brutalist, no bloat chess. Every page is only html and css. Every chess move is made by clicking a link. Send a link to your friend and they'll send you one back to make your move. No silly animations or slick interactivity to trip up your gameplay. When Google indexes this site will we successfully compute all possible chess moves? Functionality is quite limited, and things might be broken. Please let me know if you find bugs! Inspired by this HN discussion about sites that have all possible game states of tic-tac-toe. I plan on extending this to support real gameplay. I think it could be a nice simple interface for long form games with friends. Might also be fun to add a static AI to play against. Feel free to PR any changes if you'd like to see something added.
35
substrate avatar
renderMarkdown
@substrate
HTTP
Render streaming markdown
36
samwillis avatar
pglite_http_preview_runtime
@samwillis
HTTP (preview)
PGlite on Val Town - A whole Postgres in your val All you need to do is first import the Deno xmlhttprequest polyfill and then PGlite: import "https://deno.land/x/xhr@0.1.0/mod.ts"; import { PGlite } from "https://cdn.jsdelivr.net/npm/@electric-sql/pglite/dist/index.js"; Importing using esm.sh doesn't seem to work, see https://github.com/electric-sql/pglite/issues/110
37
xkonti avatar
gptApiFramework
@xkonti
Script
Allows for automatic generation of Hono API compatible with GPTs. Endpoints' inputs and outputs need to be specified via types from which the Open API spec is generated automatically and available via /gpt/schema endpoint. ⚠️ Breaking changes introduced in v23 & 24: nothingToJson doesn't take the generic TResponse anymore. The type is inferred from the endpoint definition. The endpoint definition doesn't need the requestSchema , requestDesc and responseDesc defined anymore. The descriptions are inferred from the schema description. jsonToJson doesn't take the generic TRequest and TResponse anymore. Types are inferred from the endpoint definition. The endpoint definition doesn't need the requestDesc and responseDesc defined anymore. The descriptions are inferred from the schema description. Usage example: import { GptApi } from "https://esm.town/v/xkonti/gptApiFramework"; import { z } from "npm:zod"; /** * COMMON TYPES */ const ResponseCommandSchema = z.object({ feedback: z.string().describe("Feedback regarding submitted action"), command: z.string().describe("The command for the Mediator AI to follow strictly"), data: z.string().optional().describe("Additional data related to the given command"), }).describe("Contains feedback and further instructions to follow"); /** * INITIALIZE API */ const api = new GptApi({ url: "https://xkonti-planoverseerai.web.val.run", title: "Overseer AI API", description: "The API for interacting with the Overseer AI", version: "1.0.0", policyGetter: async () => { const { markdownToPrettyPage } = await import("https://esm.town/v/xkonti/markdownToHtmlPage?v=5"); return await markdownToPrettyPage("# Privacy Policy\n\n## Section 1..."); }, }); /** * REQUIREMENTS GATHERING ENDPOINTS */ api.nothingToJson({ verb: "POST", path: "/newproblem", operationId: "new-problem", desc: "Endpoint for informing Overseer AI about a new problem presented by the User", responseSchema: ResponseCommandSchema, responseDesc: "Instruction on how to proceed with the new problem", }, async (ctx) => { return { feedback: "User input downloaded. Problem analysis is required.", command: await getPrompt("analyze-problem"), data: "", }; }); export default api.serve();
38
dglazkov avatar
discordBot
@dglazkov
Script
A simple Discord Bot scaffolding, a slight rev on the one in the valtown guide . The discordBot function takes in an object where each key is a Discord command and the value is a function to handle the command. If the function returns a Promise , it will be handled as a deferred interaction with a followup message . Usage: import { discordBot } from "https://esm.town/v/dglazkov/discordBot"; const echo = async (data) => { await new Promise((r) => setTimeout(r, 5000)); return { type: 4, data: { content: data.data.options[0].value, }, }; }; export default discordBot({ ping: () => ({ type: 4, data: { content: `Pong! It is ${new Date()}`, }, }) echo, });
39
pomdtr avatar
hono_counter
@pomdtr
Script
Hono Counter Component
40
stevekrouse avatar
valTownChatGPT
@stevekrouse
HTTP
ChatGPT Implemented in Val Town Demonstrated how to use assistants and threads with the OpenAI SDK and how to stream the response with Server-Sent Events
41
vipshek avatar
detectNewWebsiteContents
@vipshek
Cron
Detect New Website Contents This val fetches a given publicly-accessible URL and detects whether its contents have changed. If they have, it sends an email to notify about the change. Changes are detected by computing a quick hash of the website's contents, storing the hash, and comparing against the previously stored hash on each request. Trivial changes to the website's contents will count as a change, which may not be desired for some use cases. Usage Fork this val and update the URL to point to your website. Optionally, update the storage key or email subject. Set a schedule for how often you want to detect changes (default 1h). Receive updates when the given website changes.
42
tmcw avatar
pinkGalliform
@tmcw
HTTP
Something
43
nbbaier avatar
status
@nbbaier
HTTP
Uptime Status Page This is the status page for the data generated by this uptime cron: @stevekrouse/uptime
44
stevekrouse avatar
hono_react_ssr
@stevekrouse
Script
Hono React SSR Development in progress
45
stevekrouse avatar
easyAQI
@stevekrouse
Script
easyAQI Get the Air Quality Index (AQI) for a location via open data sources. It's "easy" because it strings together multiple lower-level APIs to give you a simple interface for AQI. Accepts a location in basically any string format (ie "downtown manhattan") Uses Nominatim to turn that into longitude and latitude Finds the closest sensor to you on OpenAQ Pulls the readings from OpenAQ Calculates the AQI via EPA's NowCAST algorithm Uses EPA's ranking to classify the severity of the score (ie "Unhealthy for Sensitive Groups") It uses blob storage to cache the openai location id for your location string to skip a couple steps for the next time. Example usage @stevekrouse.easyAQI({ location: "brooklyn navy yard" }) // Returns { "aqi": 23.6, "severity": "Good" } Forkable example: val.town/v/stevekrouse.easyAQIExample Also useful for getting alerts when the AQI is unhealthy near you: https://www.val.town/v/stevekrouse.aqi
46
substrate avatar
illustratedTopics
@substrate
HTTP
Generates a streaming illustrated primer on a subject. Enter a subject, click on titles to "delve". 🪩 To fork, sign up for Substrate to get your own API key and $50 free credits
47
substrate avatar
spanishVocabLesson
@substrate
HTTP
Generates spanish flashcards on a topic, including generated images and speech. 🪩 To fork, sign up for Substrate to get your own API key and $50 free credits
48
substrate avatar
subaudio
@substrate
HTTP
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
49
maxm avatar
animatedReadmeSVG
@maxm
HTTP
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>
50
yawnxyz avatar
stitchVal
@yawnxyz
HTTP
inspired by https://x.com/dankuntz/status/1813283813881225625 written by Sonnet-3.5 with ~12 prompts and some final manual tweaks
51
stevekrouse avatar
nominatimSearch
@stevekrouse
Script
Geocode a free-form description via the Nominatim API The search API allows you to look up a location from a textual description or address. Nominatim supports structured and free-form search queries. Docs: https://nominatim.org/release-docs/latest/api/Search/
52
nicoalbanese avatar
tomatoMinnow
@nicoalbanese
HTTP
Vercel AI SDK with Val Town! Use the Vercel AI SDK in your Vals. Note : you must add your OpenAI key to your Val Town Env variables under OPENAI_API_KEY . If you would like to specify a different name for your API Key, you can create a custom OpenAI provider with the createOpenAI function. Prefer another AI provider? Use any supported provider by changing just two lines of code!
53
smendoza787 avatar
aqi
@smendoza787
Cron
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
54
substrate avatar
twitterRAG
@substrate
HTTP
NOTE: We've disabled the Exa API key in this demo due to high volume – you'll need to fork and provide your own to use it. Search on Twitter (powered by Exa ) and return a streaming markdown summary (powered by Substrate ). To fork, sign up for Substrate to get your own API key and $51 free credits. You'll also need Exa, which comes with generous free credits and can be a much cheaper alternative to the Twitter API.
55
pomdtr avatar
excalidraw
@pomdtr
HTTP
Excalidraw, embedded inside Val Town ! The drawing will be persisted in your blobs as json / png / svg. You can access the drawing source directly using the /json , /png and /svg subpaths. For example, to embed the image in a markdown document, you can use: ![pomdtr-excalidraw.web.val.run](https://pomdtr-excalidraw.web.val.run/png)
56
substrate avatar
renderNodeResults
@substrate
HTTP
Render streaming node results
57
cotr avatar
get_gemini_models
@cotr
Script
List all of the Gemini AI models: https://ai.google.dev/tutorials/rest_quickstart#list_models
58
pomdtr avatar
static
@pomdtr
HTTP
Static Vals Serve static content from val.town Usage First, fork this val to get your own http endpoint. Then create a val that uses a string as it's default export, or a single string export. The val must be either public or unlisted . export default `<static content>` You can then fetch the exported string from outside val.town using: curl 'https://<owner>-static.web.val.run/<val>.<extension>' The Content-Type will be dynamically set depending on the provided extension. Example https://pomdtr-static.web.val.run/val_town_readme_style.css Val Link
59
stevekrouse avatar
weatherGovGrid
@stevekrouse
Script
Lookup a weather.gov grid by lat, lon Documentation: https://www.weather.gov/documentation/services-web-api Forecasts are created at each NWS Weather Forecast Office (WFO) on their own grid definition, at a resolution of about 2.5km x 2.5km. The API endpoint for the 12h forecast periods at a specific grid location is formatted as: https://api.weather.gov/gridpoints/{office}/{gridX},{gridY}/forecast For example: https://api.weather.gov/gridpoints/TOP/31,80/forecast To obtain the grid forecast for a point location, use the /points endpoint to retrieve the current grid forecast endpoint by coordinates: https://api.weather.gov/points/{latitude},{longitude} For example: https://api.weather.gov/points/39.7456,-97.0892
60
mebmeb avatar
weatherGPT
@mebmeb
Cron