Back to APIs list

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.
cdnclass avatar
pollRSSFeeds
@cdnclass
Cron
Forked from stevekrouse/pollRSSFeeds
pomdtr avatar
verifyToken
@pomdtr
Script
An interactive, runnable TypeScript val by pomdtr
yawnxyz avatar
openAIHonoChatStreamExample
@yawnxyz
HTTP (deprecated)
Forked from jacoblee93/streamingTest
zak avatar
hnFollowPollJob
@zak
Script
An interactive, runnable TypeScript val by zak
saolsen avatar
telemetry
@saolsen
Script
Telemetry For Vals. Telemetry is a library that lets you trace val town executions with opentelemetry. All traces are stored in val.town sqlite and there is an integrated trace viewer to see them. Quickstart Instrument an http val like this. import { init, tracedHandler, } from "https://esm.town/v/saolsen/telemetry"; // Set up tracing by passing in `import.meta.url`. // be sure to await it!!! await init(import.meta.url); async function handler(req: Request): Promise<Response> { // whatever else you do. return } export default tracedHandler(handler); This will instrument the http val and trace every request. Too add additional traces see this widgets example . Then, too see your traces create another http val like this. import { traceViewer } from "https://esm.town/v/saolsen/telemetry"; export default traceViewer; This val will serve a UI that lets you browse traces. For example, you can see my UI here . Tracing By wrapping your http handler in tracedHandler all your val executions will be traced. You can add additional traces by using the helpers. trace lets you trace a block of syncronous code. import { trace } from "https://esm.town/v/saolsen/telemetry"; trace("traced block", () => { // do something }); traceAsync lets you trace a block of async code. import { traceAsync } from "https://esm.town/v/saolsen/telemetry"; await traceAsync("traced block", await () => { // await doSomething(); }); traced wraps an async function in tracing. import { traceAsync } from "https://esm.town/v/saolsen/telemetry"; const myTracedFunction: () => Promise<string> = traced( "myTracedFunction", async () => { // await sleep(100); return "something"; }, ); fetch is a traced version of the builtin fetch function that traces the request. Just import it and use it like you would use fetch . sqlite is a traced version of the val town sqlite client. Just import it and use it like you would use https://www.val.town/v/std/sqlite attribute adds an attribute to the current span, which you can see in the UI. event adds an event to the current span, which you can see in the UI.
janpaul123 avatar
valle_tmp_42249988258651369468890296933772
@janpaul123
HTTP (deprecated)
// Initialize sample stories and store them in blob storage
neverstew avatar
registerDiscordSlashCommandExample
@neverstew
Script
An interactive, runnable TypeScript val by neverstew
stevekrouse avatar
sqlite_admin_table
@stevekrouse
Script
@jsxImportSource https://esm.sh/hono@3.9.2/jsx
xuybin avatar
vscode
@xuybin
HTTP (deprecated)
Forked from pomdtr/vscode
sarahxc avatar
redditSearch
@sarahxc
HTTP
Use Browserbase and Puppeteer to monitor and scrape reddit search results.
stevekrouse avatar
fetchRSS
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
vtdocs avatar
planetScaleShowTablesExample
@vtdocs
Script
An interactive, runnable TypeScript val by vtdocs
webup avatar
chatSampleFunctionSingle
@webup
Script
An interactive, runnable TypeScript val by webup
stevekrouse avatar
threadsafeStateEx
@stevekrouse
Script
// set by stevekrouse.updateThreadsafeStateEx at 2023-07-23T05:21:52.145Z
johnmuyskens avatar
nearestOpenStation
@johnmuyskens
Script
An interactive, runnable TypeScript val by johnmuyskens
g avatar
csvViewer
@g
HTTP
* This application creates a CSV viewer using a Hono app that serves a client-side application. * It allows users to upload a CSV file, view its contents in a table format, and provides basic sorting functionality. * * The approach: * 1. Create a server-side Hono app to handle file uploads and serve the HTML, CSS, and JavaScript. * 2. Implement client-side JavaScript to handle file reading, parsing CSV, and displaying the data in a table. * 3. Add sorting functionality to allow users to sort the table by clicking on column headers. * * Libraries used: * - Hono for the server-side application * - Papa Parse (via esm.sh) for parsing CSV on the client-side