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.
ejfox
eclipsetoday
HTTP
NAME eclipsetoday - Determine if a solar or lunar eclipse is happening right now DESCRIPTION The script checks if there's a solar or lunar eclipse
currently occurring anywhere on Earth. The script
utilizes a hardcoded list of known eclipses for the
years 2024-2026.
It will return a JSON response indicating whether an eclipse is happening
at the time of the request, along with details about the eclipse if applicable. USAGE The script is designed to be run in a server environment, responding to
incoming HTTP requests. Upon receiving a request, it will return JSON data
in the following format:
```
{
"isEclipseHappening": true/false,
"eclipseDetails": {
"date": "2024-04-08T00:00:00Z",
"kind": "solar",
"type": "total",
"place": "partial: North and Central America; total: northern Mexico, central U.S., and eastern Canada"
},
"checkedAt": "2024-04-08T00:00:00Z"
}
```
If an error occurs during processing, the script will return a JSON error
message with details about the failure.
0
iamseeley
savePDF
Script
🗃️ save your html as a pdf using html2pdf // Adjust the options
html2pdf(element, {
margin: 0.2,
filename: 'resume.pdf',
image: { type: 'jpeg', quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
}) usage <!-- Add the button to your html -->
<body>
<button id="saveAsPDFButton">Save as PDF</button>
<!-- Import the module -->
<script type="module" src="https://esm.town/v/iamseeley/savePDF"></script>
</body>
0