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.
tmcw avatar
tmcw
openAQLocation
Script
An interactive, runnable TypeScript val by tmcw
0
stevekrouse avatar
stevekrouse
ohno
Script
An interactive, runnable TypeScript val by stevekrouse
0
pomdtr avatar
pomdtr
exampleArticle
HTTP
Example Article More detail on the discovery mechanism here . Fork this val to create a new post!
0
yawnxyz avatar
yawnxyz
processTextInChunks
Script
Text Chunk Processor This JavaScript function processes long text inputs by breaking them into smaller chunks, applying a custom processing function to each chunk, and optionally handling overlaps between chunks. Function Signature processTextInChunks(inputText, processFn, config) Parameters inputText (string): The long input text to be processed. processFn (function, optional): A function to process each chunk. Defaults to logging the chunk. config (object, optional): Configuration options. Config Options chunkLength (number): Length of each chunk. Default: 1000. overlapLength (number): Length of overlap between chunks. Default: 0. Usage const longText = "Your very long text here..."; const result = processTextInChunks(longText, (mainChunk, overlapChunk, info) => { // Process the chunk here console.log(`Processing chunk from ${info.startIndex} to ${info.endIndex}`); console.log(`Main chunk: ${mainChunk}`); console.log(`Overlap: ${overlapChunk}`); return mainChunk.length; // Example return value }, { chunkLength: 500, overlapLength: 50 } ); console.log(result); Notes If processFn is not provided, the function will log each chunk and return the original text. If processFn returns a value, these values will be collected in an array and returned. If processFn doesn't return anything, the original input text is returned. The processFn receives three arguments: mainChunk : The current chunk of text being processed. overlapChunk : The overlapping text from the previous chunk (empty for the first chunk). An info object containing: startIndex : Start index of the current chunk in the original text. endIndex : End index of the current chunk in the original text. isLastChunk : Boolean indicating if this is the last chunk. Use Cases Processing large texts in smaller, manageable pieces. Applying transformations or analysis to text while maintaining context through overlaps. Tokenization or parsing of large documents.
0
steveruizok avatar
steveruizok
mathFact
Script
An interactive, runnable TypeScript val by steveruizok
0
DFB avatar
DFB
FunIDorPassword
HTTP
An interactive, runnable TypeScript val by DFB
0
kutasartem avatar
kutasartem
createHorror3DGame
HTTP
@jsxImportSource https://esm.sh/react@18.2.0
0
janpaul123 avatar
janpaul123
valle_tmp_275862191060511468456294552341596
HTTP
// This val will respond with a simple HTML page saying "Hello, world!"
0
rozek avatar
rozek
GDI_AIChatCompletion
HTTP
This val is part of a series of examples to introduce "val.town" in my computer science course at Stuttgart University of Applied Sciences . The idea is to motivate even first-semester students not to wait but to put their ideas into practice from the very beginning and implement web apps with frontend and backend. It contains a simple web page which allows users to enter a "System Message" and a "User Message" in order to be sent to a preconfigured server. That server then runs a chat completion and returns the computed "Assistant Message" back to the client where the result is presented to the user. This val is the companion of https://rozek-gdi_aichatcompletionservice.web.val.run/ which contains the server part (aka "backend") for this example. The code was created using Townie - with only a few small manual corrections. This val is licensed under the MIT License.
0
Sainmt avatar
Sainmt
savvyOrangeCondor
HTTP
Forked from mewtru/valentine
0
Prime avatar
Prime
valentine
HTTP
Forked from mewtru/valentine
0
stevekrouse avatar
stevekrouse
PaLM
Script
An interactive, runnable TypeScript val by stevekrouse
0
webup avatar
webup
pipeSampleLLMTool
Script
An interactive, runnable TypeScript val by webup
1
stevekrouse avatar
stevekrouse
hnLegends
Script
An interactive, runnable TypeScript val by stevekrouse
0
iamseeley avatar
iamseeley
clientMultirouteReact
HTTP
🌐 Client-Side Rendered React App via CDN
0
stevekrouse avatar
stevekrouse
gpt4
Script
Forked from rlimit/gpt4
0