Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Monitors the status of multiple variations via the ARC Research Office API.
- Multi-ID Tracking: Monitors an unlimited number of variation IDs simultaneously.
- Smart Notifications: Bundles all detected status changes into a single, clean email (including your custom descriptions) to prevent inbox spam.
- State Management: Uses Val Town's standard SQLite database for robust, permanent storage of your variation IDs and their last known statuses.
- OPSEC-Friendly Scheduling: Uses a time-zone-aware gatekeeper script driven by environment variables to handle Daylight Saving Time (DST) and mask operational schedules.
- Remix this Project in Val Town to create your own private copy.
- Note the two main files in your project sidebar: the setup script (e.g.,
init-db.ts) and the daily tracker (main.ts).
Navigate to your Val Town Settings -> Environment Variables (Secrets) and add the following keys.
| Variable | Description | Example |
|---|---|---|
ARC_API_KEY | Your private ARC API key. | 00000000-0000-0000... |
If left unset, the script will default to running 24/7.
| Variable | Description | Example |
|---|---|---|
TRACKING_TIMEZONE | Your local time zone (IANA format) to handle DST automatically. | Australia/Melbourne |
TRACKING_START_HOUR | The hour to begin tracking (24-hour format). | 9 |
TRACKING_END_HOUR | The hour to stop tracking (24-hour format). | 17 |
TRACKING_WORK_DAYS | Comma-separated days of the week to run (0=Sun, 1=Mon... 6=Sat). | 1,2,3,4,5 |
- Open your setup script (e.g.,
init-db.ts). - Click the Run button manually exactly one time.
- Check the console log at the bottom of the screen to confirm the
tracked_variationstable was created successfully.
- Navigate to the SQLite tab on the left sidebar in your Val Town workspace.
- Click on the
tracked_variationstable. - Manually add a row for each grant you want to track:
- Enter the
variation_id(e.g.,1234567). - Enter a custom
description(e.g.,End of Year Correction). - Note: You can safely leave
added_atblank (NULL). The main tracking script will automatically stamp the correct date and time for you when it first runs.
- Enter the
- Open
main.ts. - Ensure the trigger at the top is set to Scheduled (Cron).
- Set the schedule to run every 30 minutes using the cron expression:
*/30 * * * *
- Trigger: Val Town runs
main.tsevery 30 minutes. - Gatekeeper: The script checks the current time against your hidden
TRACKING_TIMEZONEand schedule. If outside configured business hours, it quietly exits. - Fetch: It queries your SQLite database to retrieve all active variation IDs and their custom descriptions.
- Compare: It pings the ARC API for each ID and compares the live response
against the
last_statussaved in the database. - Notify & Update: If differences are found, it sends a single bundled email to the Val Town account owner and updates the SQLite database with the new statuses.