Back to APIs list

Air quality API examples & templates

Use these vals as a playground to view and fork Air quality API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
robsimmons avatar
aoc_2023_10_2
@robsimmons
Script
Forked from robsimmons/aoc_2023_10_1
movienerd avatar
randomMovieQuiz
@movienerd
HTTP (preview)
@jsxImportSource https://esm.sh/react
saolsen avatar
gameplay_poker
@saolsen
Script
gameplay_poker This is a val.town mirror of gameplay/games/poker . Click the link to see docs.
stevekrouse avatar
karma
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
vladimyr avatar
pipeResponse
@vladimyr
Script
// SPDX-License-Identifier: 0BSD
stevekrouse avatar
dm
@stevekrouse
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
dthyresson avatar
bedtimeStoriesDb
@dthyresson
Script
// query all bedtime stories
karfau avatar
aoc23_07
@karfau
Script
Forked from karfau/aocXX_00
stu43005 avatar
hololiveAnniversaryData
@stu43005
Script
Data Source: https://seesaawiki.jp/hololivetv/d/%B5%AD%C7%B0%C6%FC Auto gen by @stu43005.genHololiveAnniversaryData
vladimyr avatar
jwkToDidKey_tests
@vladimyr
Script
// @see: https://w3c-ccg.github.io/did-method-key/#example-5
nickfrosty avatar
blink_create_tree
@nickfrosty
Script
* Solana Actions Example
sairamoe avatar
testHTML
@sairamoe
Script
Forked from tr3ntg/testHTML
tmcw avatar
typeboxTest
@tmcw
Script
An interactive, runnable TypeScript val by tmcw
easrng avatar
valSign
@easrng
Script
secure signatures with vals setup you'll need to make 2 new vals: generate a keypair (keep this val private) let vsExportedKeys = @easrng.generateKeys(); publish your public key (make this val public) const vsPublicKey = () => @me.exportedKeys.publicKey; usage sign call @easrng.valSign to get a signature. const signature = await @easrng.valSign({ keys: @me.vsExportedKeys, data: {hello: "world"}}) the result will look something like this: @easrng.htVgaVWWtvnz5AK0DnDaNON5gar5qJeaorfsTCiIr7ua_-D4HPmFrIrPMfwmCaMvI0CxKlYCUe9XTGm7r5s5C3siZGF0YSI6eyJoZWxsbyI6IndvcmxkIn0sInVzZXIiOiJlYXNybmciLCJleHByIjpudWxsfQ you can also set an expiration date: const signature = await @easrng.valSign({ keys: @me.vsExportedKeys, data: "this expires in 1 second", expireIn: 1000 }) verify call @easrng.valSignVerify to verify a signature const { data, handle, expiresAt } = await @easrng.valSignVerify(signature) with the example signature from earlier, data would be {hello: "world"} , handle would be easrng , and expiresAt would be null
shawnbasquiat avatar
placeholderImages
@shawnbasquiat
HTTP (preview)
// This val creates a kitten image generator using the Val Town image generation API.
jdan avatar
traversePairwise
@jdan
Script
An interactive, runnable TypeScript val by jdan