US Congress Stock Trading API examples & templates
Use these vals as a playground to view and fork US Congress Stock Trading API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
minifyHTML
@yieldray
Script
Usage: import { minifyHTML } from "https://esm.town/v/yieldray/minifyHTML";
const minified = await minifyHTML("<html>...</html>", { ...options }); As an API: import { runVal } from "https://esm.town/v/std/runVal";
const minified = awaitrunVal("yieldray.minifyHTML", "<html>...</html>", { ...options });
inTheBackgroundExample
@neverstew
HTTP (deprecated)
inTheBackground With the addition of the "early return" feature of web handlers, you can now process short background tasks in vals. This can be really useful for occasions where an immediate response is required, with a subsequent update a few seconds later e.g. a Discord bot that calls ChatGPT needs to respond within a few seconds, which can be too fast for the AI to generate a response. We can instead reply immediately and then update that message later, inTheBackground Simply wrap something in inTheBackground and it will do just that! In this example, we log something a few seconds later than the web response is sent back.