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.
michaelwschultz
generateframeImage
HTTP
Gathers information and returns an image of this val Why I'm using this val for my 3-color e-ink display run by a Raspberry Pi Zero W. The Pi runs a cron job that tell's it
to fetch this url twice a day and render it to the display. Works like a charm. Right now I'm not displaying much but I'm going to keep iterating on what type of information I want to display. How I'll post more info on my set up here later if you want to try something similar. But I assume this workflow could
be used for lot's of different projects that don't have a ton of compute or where you don't want to learn how to
actually draw things to a screen like all the e-ink display libraries.
1

stevekrouse
classless_css
HTTP
Utilities for Classless CSS Forked from Paul Kinlan's Classless CSS Demo Usage For projects that should be pretty in an unopinionated way import { randomStyle } from "https://esm.town/v/stevekrouse/classless_css";
export default async function(req: Request): Promise<Response> {
return new Response(`<h1>Welcome to Val Town!</h1>${randomStyle}`, {
headers: {
"Content-Type": "text/html",
},
});
}
2
postpostscript
fetchWorker
Script
fetchWorker: communicate with a worker over a fetch -like interface! Example: import { fetchWorker } from "https://esm.town/v/postpostscript/fetchWorker";
using worker = await fetchWorker({
url: "https://esm.town/v/postpostscript/fetchWorkerExample",
handler: "handler",
});
const res = await worker.fetch("/", {
method: "POST",
body: JSON.stringify({
test: 1,
}),
headers: {
"Content-Type": "application/json",
},
});
console.log(await res.json());
// {
// method: "POST",
// url: "https://7ae81ab0-04cf-485a-ae09-054c4d3be6b3.val.town/",
// text: { test: 1 },
// headers: { "content-type": "application/json" }
// } Full Example Options: url ( string , required): URL that the worker will fetch the handler from handler ( string , defaults to default ): name of export that will execute the request
0