Skip to content

Instantly share code, notes, and snippets.

View Gaelan's full-sized avatar
🏳️‍⚧️

Gaelan Steele Gaelan

🏳️‍⚧️
View GitHub Profile
@Gaelan
Gaelan / fife.ts
Created February 15, 2024 19:43
Get Fife bin calendar
import PQueue from "p-queue";
import fetch, { Request, RequestInit, Response } from "node-fetch";
import { z } from "zod";
import { Temporal } from "@js-temporal/polyfill";
class HTTPError extends Error {}
// be nice to the council: one request per second, never more than one at a time
const queue = new PQueue({ concurrency: 1, interval: 5000, intervalCap: 5 });