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.
christian avatar
usdBTC
@christian
Script
// Get the current price of Bitcoin in US dollars
dexa avatar
usdETH
@dexa
Script
// Get the current price of Ethereum in US dollars
evan avatar
usdETH
@evan
Script
// Get the current price of Ethereum in US dollars
ashish avatar
usdBTC
@ashish
Script
An interactive, runnable TypeScript val by ashish
greeffer avatar
usdETH
@greeffer
Script
// Get the current price of Ethereum in US dollars
devon avatar
usdETH
@devon
Script
// Get the current price of Ethereum in US dollars
weaverwhale avatar
generateMerchantTransactionData
@weaverwhale
Script
// console.log(generateMerchantTransactionData());
stevekrouse avatar
newRSSItems
@stevekrouse
Script
An interactive, runnable TypeScript val by stevekrouse
tmm avatar
usdETH
@tmm
Script
// Get the current price of Ethereum in US dollars
cyrilos avatar
litepickbet
@cyrilos
HTTP
cookies manager class
webup avatar
chat
@webup
Script
An interactive, runnable TypeScript val by webup
stevekrouse avatar
pollRSSFeeds
@stevekrouse
Cron
Poll RSS feeds This val periodically polls specified RSS feeds and send the author an email with new items. It checks each feed defined in rssFeeds for new content since the last run and sends an email with the details of the new items. Usage Fork @stevekrouse/rssFeeds and update it with your desired RSS feeds; Fork this val and replace the https://esm.town/v/stevekrouse/rssFeeds import with your newly forked val; Enjoy RSS updates on your email!
andreterron avatar
codeOnValTown
@andreterron
Script
Code on Val Town Adds a "Code on Val Town" ribbon to your page. This lets your website visitors navigate to the code behind it. This uses github-fork-ribbon-css under the hood. Usage Here are 2 different ways to add the "Code on Val Town" ribbon: 1. Wrap your fetch handler (recommended) import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50"; import { html } from "https://esm.town/v/stevekrouse/html?v=5"; export default modifyFetchHandler(async (req: Request): Promise<Response> => { return html(`<h2>Hello world!</h2>`); }); Example: @andreterron/openable_handler 2. Wrap your HTML string import { modifyHtmlString } from "https://esm.town/v/andreterron/codeOnValTown?v=50"; import { html } from "https://esm.town/v/stevekrouse/html?v=5"; export default async (req: Request): Promise<Response> => { return html(modifyHtmlString(`<h2>Hello world!</h2>`)); }; Example: @andreterron/openable_html Other ways We made sure this was very modular, so you can also add the ribbon using these methods: Get the element string directly: @andreterron/codeOnVT_ribbonElement Modify an HTTP Response: @andreterron/codeOnVT_modifyResponse Use .pipeThrough to append to a stream: @andreterron/InjectCodeOnValTownStream Customization Linking to the val These functions infer the val using the call stack or the request URL. If the inference isn't working, or if you want to ensure it links to a specific val, pass the val argument: modifyFetchHandler(handler, {val: { handle: "andre", name: "foo" }}) modifyHtmlString("<html>...", {val: { handle: "andre", name: "foo" }}) Styling You can set the style parameter to a css string to customize the ribbon. Check out github-fork-ribbon-css to learn more about how to style the element. modifyFetchHandler(handler, {style: ".github-fork-ribbon:before { background-color: #333; }"}) modifyHtmlString("<html>...", {style: ".github-fork-ribbon:before { background-color: #333; }"}) Here's how you can hide the ribbon on small screens: modifyFetchHandler(handler, {style: `@media (max-width: 768px) { .github-fork-ribbon { display: none !important; } }`}) To-dos [ ] Let users customize the ribbon. Some ideas are the text, color or placement.
ejfox avatar
valcontributionchart
@ejfox
HTTP (preview)
// This approach will fetch data from the specified endpoint, process it to create a GitHub-style contribution chart,
dharmatech avatar
rrp
@dharmatech
Script
An interactive, runnable TypeScript val by dharmatech
jamisonl avatar
handleDiscordInteraction
@jamisonl
HTTP
Forked from camajudson/handleDiscordInteraction