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.
stevekrouse
stripHTML
Script
Strip HTML Remove HTML tags from a string by parsing the HTML. There are certainly faster ways of doing this, ie html.replace(/<\/[^>]+(>|$)/g, "")
// source https://stackoverflow.com/a/5002161 but this way is likely the most correct in that you're using a proper HTML parser.
1
tmcw
httpMockingExample
HTTP
HTTP Val Mocking example This is an example of mocking an HTTP val. Let's say that you're developing a val that responds to a POST request. That's tricky to debug and develop in the Browser preview tab, which just shows a GET request. But you can do it, because with web-standard Request & Response objects, requests and responses are values, and we can create those values ourselves.
1
singpolyma
sendxmppapi
HTTP
Simple API for sending a message over XMPP to any Jabber ID on the federated network. For a wrapper to use in vals see https://www.val.town/v/singpolyma/sendxmpp await fetch("https://singpolyma-sendxmppapi.web.val.run", {
method: "POST",
body: JSON.stringify({ target: "someone@example.com", body: "Hello!" })
})
0