Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sandyjmacdonald/york-bins
Bun/Hono/Cloudflare Workers app to get next York bin collection from a York UPRN
https://github.com/sandyjmacdonald/york-bins
bun cloudflare-workers hono
Last synced: 19 days ago
JSON representation
Bun/Hono/Cloudflare Workers app to get next York bin collection from a York UPRN
- Host: GitHub
- URL: https://github.com/sandyjmacdonald/york-bins
- Owner: sandyjmacdonald
- Created: 2024-08-17T21:09:27.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-31T10:00:07.000Z (4 months ago)
- Last Synced: 2024-10-31T03:06:04.445Z (2 months ago)
- Topics: bun, cloudflare-workers, hono
- Language: TypeScript
- Homepage: https://york-bins.sandyjmacdonald.workers.dev/next-bin/
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This simple Cloudflare Workers app provides an API endpoint that can be given a UPRN (Unique Property Reference Number, find yours [here](https://www.findmyaddress.co.uk/search)) for the City of York Council area and it will return a JSON response as below, with which collection (rubbish/recyling) is next and the date on which it is due to be collected:
```bash
curl https://york-bins.sandyjmacdonald.workers.dev/next-bin/your-uprn-here{
"collection": "recycling",
"date": "2024-08-30T00:00:00.000Z"
}
```This is really useful when used as part of an iOS shortcut to either simply query the API and return the collection/date, or as an automated shortcut that runs every Monday and then sets an iOS Reminder for the night before reminding you to put the appropriate bins out for collection.
## How to deploy locally, or to Cloudflare Workers
1. Set up a Cloudflare account: [https://dash.cloudflare.com/sign-up](https://dash.cloudflare.com/sign-up)
2. Install node.js/npm
3. `git clone https://github.com/sandyjmacdonald/york-bins`
4. `cd york-bins`
5. `npm install`
6. Install Bun: `curl -fsSL https://bun.sh/install | bash`To test locally:
`bun run dev`
To deploy your own version to Cloudflare Workers:
`bun run deploy`