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.
nbbaier
filterVals
Script
filterVals This val exports a utility function that returns a list of all a user's val, filtered by a callback function. Example Get the names of all your private vals: import { filterVals } from "https://esm.town/v/nbbaier/filterVals";
const id = <user_id>
const vals = await filterVals(id, (v) => v.privacy === "private")
const privateValNames = vals.map(v => v.name);
1
iamseeley
threedEmoji
Script
3️⃣ 🇩 create 3d emojis and text with three.js example usage: include a container in your HTML <div id="3d-emoji" style="width: 300px; height: 300px;"></div> call the function after the DOM has loaded import { create3DEmoji } from 'https://esm.town/v/iamseeley/threedEmoji';
document.addEventListener('DOMContentLoaded', () => {
create3DEmoji('😊', 300, 300);
});
0
![stevekrouse avatar](https://images.clerk.dev/uploaded/img_2PqHa2Gsy93xQrjh2w78Xu0cChW.jpeg)
stevekrouse
renderEmails
Email
Forward Render Error Emails to Github & Discord Render sends emails when deploys fail but I want those
notifications to come in our team Discord channel,
and tag our team.
Render doesn't have webhooks for this,
so I set up a Gmail filter and
forward to this email handler val,
which in turn forwards the content to our engineering Discord channel. I also found myself wanting this script to auto-create
Github Issues, assigned to the right person, in our current milestone,
so now this script does that, with @stevekrouse/createIssue as the helper function.
0
jamiedubs
databin
HTTP
a super simple JSON setter/getter using valtown blobs. use GET to fetch it, use POST to set it. expects the inbound data to be JSON for simplicity. use ?key=foobar to specify different storage locations. set: curl -s -X POST -d '{"lol": "wut"}' https://jamiedubs-databin.web.val.run?key=foobar get: curl -s https://jamiedubs-databin.web.val.run?key=foobar
# {"lol":"wut"}
0