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.
augustohp avatar
augustohp
BalanceAntiCaptcha
Script
An interactive, runnable TypeScript val by augustohp
0
mikaello avatar
mikaello
createAllHighLlightJsLanguages
HTTP
Forked from stevekrouse/docFeedbackForm
0
rayman avatar
rayman
purpleBee
HTTP
Forked from rayman/QuillEditor
0
rozek avatar
rozek
Authorization_from_SQLite_Test
HTTP
Here are some tests for val Authorization_from_SQLite Test Cases Positive Test Cases Valid credentials with existing user TableName: "Authorization_from_SQLite_Test" Database content: UserId "alice", PasswordHash "{PBKDF2}10000$salt123$hashedPassword123" Authorization header: "Basic " + btoa("alice:correctPassword") Expected result: true Valid credentials with case-insensitive UserId TableName: "Authorization_from_SQLite_Test" Database content: UserId "Bob", PasswordHash "{PBKDF2}10000$salt456$hashedPassword456" Authorization header: "Basic " + btoa("bob:correctPassword") Expected result: true Negative Test Cases Invalid password TableName: "Authorization_from_SQLite_Test" Database content: UserId "charlie", PasswordHash "{PBKDF2}10000$salt789$hashedPassword789" Authorization header: "Basic " + btoa("charlie:wrongPassword") Expected result: false No Authorization header TableName: "Authorization_from_SQLite_Test" Database content: UserId "david", PasswordHash "{PBKDF2}10000$saltABC$hashedPasswordABC" Authorization header: undefined Expected result: false Non-existent user TableName: "Authorization_from_SQLite_Test" Database content: (empty) Authorization header: "Basic " + btoa("eve:anyPassword") Expected result: false Error Cases Invalid table name TableName: "1INVALID" Authorization header: "Basic " + btoa("frank:password") Expected result: Error thrown Edge Cases Empty string as password TableName: "Authorization_from_SQLite_Test" Database content: UserId "grace", PasswordHash "{PBKDF2}10000$saltDEF$hashedEmptyPassword" Authorization header: "Basic " + btoa("grace:") Expected result: true (if the empty password hashes correctly) Non-Basic authorization type TableName: "Authorization_from_SQLite_Test" Database content: UserId "henry", PasswordHash "{PBKDF2}10000$saltGHI$hashedPasswordGHI" Authorization header: "Bearer " + btoa("henry:password") Expected result: false Malformed PasswordHash in database TableName: "Authorization_from_SQLite_Test" Database content: UserId "isaac", PasswordHash "malformedHash" Authorization header: "Basic " + btoa("isaac:password") Expected result: false Very long UserId (at 256 character limit) TableName: "Authorization_from_SQLite_Test" Database content: UserId (256 'a' characters), PasswordHash "{PBKDF2}10000$saltJKL$hashedPasswordJKL" Authorization header: "Basic " + btoa("a".repeat(256) + ":password") Expected result: true (if password is correct) UserId exceeding 256 characters TableName: "Authorization_from_SQLite_Test" Authorization header: "Basic " + btoa("a".repeat(257) + ":password") Expected result: false (as it shouldn't exist in the database) Empty UserId TableName: "Authorization_from_SQLite_Test" Authorization header: "Basic " + btoa(":password") Expected result: false
0
fuafuafh avatar
fuafuafh
isMyWebsiteDown
Script
Forked from healeycodes/isMyWebsiteDown
0
mepuka avatar
mepuka
rideWithGPSredirect
Script
An interactive, runnable TypeScript val by mepuka
0
yurivish avatar
yurivish
iopEmail
HTTP
Forked from neverstew/saveFormData
0
julesb22 avatar
julesb22
FetchBasic
HTTP
Forked from hunty/FetchBasic
0
easrng avatar
easrng
uploadTo0x0
Script
upload to 0x0.st usage: import { uploadTo0x0 } from "https://esm.town/v/easrng/uploadTo0x0" console.log(await uploadTo0x0("test data", "filename")) data can be a string, a TypedArray, an ArrayBuffer, or a Blob returns a url (ie https://0x0.st/X-wB.txt ) to a file that expires after an hour
4
vbnm avatar
vbnm
tell
Script
An interactive, runnable TypeScript val by vbnm
0
agmm avatar
agmm
teapot
HTTP
An interactive, runnable TypeScript val by agmm
1
evol avatar
evol
labLogin
HTTP
Forked from todepond/labLogin
0
todepond avatar
todepond
labUploadUpload
HTTP
An interactive, runnable TypeScript val by todepond
0
adagradschool avatar
adagradschool
claude_033a69fc_cc3e_4691_a940_2386d3a0a00f
HTTP
An interactive, runnable TypeScript val by adagradschool
0
jdan avatar
jdan
hashmail
Script
Forked from stevekrouse/testEmail2
1
nbbaier avatar
nbbaier
submitPR
Script
Submit a PR from Val Town This val provides a (very) thin wrapper around the GH rest API methods for creating a pull request. It handles the creation of a Octokit client for you. Usage import { submitPR } from "https://esm.town/v/nbbaier/submitPR"; await submitPR(Deno.env.get("GH_REPO_TOKEN"), { owner: "nbbaier", repo: "test-ground", head: "branch_2", base: "main", title: "trying another PR", body: "cool stuff, take a look", }); Parameters The function takes two parameters: your gh access token and an object that's identical to the object submitted to the gh API. See GH's documentation for more info!
0