Send alert the day before and on the day of bin collection in Harlow
Project description
Harlow Bindicator
Table of Contents
- Introduction
- Features
- Installation
- Configuration
- Usage
- Examples
- Notification Format
- Troubleshooting
- FAQ
- Architecture
- Contributing
- License
- Acknowledgements
Introduction
Harlow Bindicator is an automated tool that helps Harlow residents stay informed about their bin collection schedules. The application scrapes the Harlow Local Authority website to retrieve bin collection dates for a specified property and sends timely notifications through ntfy.sh when bins need to be put out. Never miss bin day again!
A "bindicator" is a notification system for bin collection days - the name is a blend of "bin" and "indicator."
Features
- Automatically retrieves bin collection dates from the Harlow Local Authority website
- Sends notifications when bins need to be put out
- Specifies which bin type needs collection (recycling, general waste)
- Can be run locally or as a GitHub Action
- Easy setup and configuration
- Customizable notification options
- Cross-platform compatibility
Installation
Prerequisites
- Python 3.7 or higher
- Chromedriver (for web scraping)
- Internet connection
- A UPRN (Unique Property Reference Number) for your address
- A ntfy.sh topic for notifications
PyPI Installation
The easiest way to install Harlow Bindicator is via pip:
pip install harlow-bindicator
Manual Installation
If you prefer to install from source:
git clone https://github.com/joe-mccarthy/harlow-bindicator.git
cd harlow-bindicator
pip install -e .
Platform-Specific Dependencies
Debian/Ubuntu
sudo apt-get install chromium-chromedriver
macOS
brew install --cask chromedriver
Windows
Download ChromeDriver from https://chromedriver.chromium.org/downloads and add it to your PATH.
Configuration
Required Parameters
- UPRN: Unique Property Reference Number that identifies your property. You can find your UPRN at Find My Address.
- ntfy.sh Topic: Create a unique topic name at ntfy.sh to receive notifications.
Usage
Running as a GitHub Action
There's a workflow file in this repository, check-binday.yml, which is scheduled to run early each morning to check for bin collections.
To use this workflow:
- Fork this repository
- Add two repository secrets in your GitHub settings:
UPRN: Your property's Unique Property Reference NumberNTFY_TOPIC: Your ntfy.sh topic name
- Enable GitHub Actions for your repository
The workflow will run automatically according to the schedule defined in the workflow file.
Running Locally
After installation, you can run Harlow Bindicator from the command line:
harlow-bindicator --uprn "12345678" --topic "your-topic-name"
Command Line Options
harlow-bindicator [OPTIONS]
Options:
--uprn TEXT UPRN for the property to check [required]
--topic TEXT ntfy.sh topic to publish notifications to [required]
Scheduling with Cron
To run automatically on Linux/macOS, add a cron job:
# Edit crontab
crontab -e
# Add this line to run at 7:00 AM every day
0 7 * * * /usr/local/bin/harlow-bindicator --uprn "12345678" --topic "your-topic-name"
Examples
Basic Usage
harlow-bindicator --uprn "12345678" --topic "bin-notifications"
Notification Format
When a bin collection is detected, you will receive a notification via ntfy.sh with:
- Title: "Bin Collection Tomorrow: [Bin Type]"
- Message: Information about which bin(s) need to be put out
- Priority: Default (adjustable in future versions)
Example notification:
Bin Collection Tomorrow: Recycling
Please put out your Blue Recycling bin tonight for collection tomorrow.
Troubleshooting
Common Issues
-
ChromeDriver Error:
- Make sure ChromeDriver is installed and in your PATH
- Check if the ChromeDriver version matches your Chrome version
-
No Notifications Received:
- Verify your ntfy.sh topic is correct
- Check if you're subscribed to the topic in ntfy.sh
- Ensure your internet connection is stable
-
UPRN Not Working:
- Double-check your UPRN is correct
- Verify your property is within the Harlow Local Authority area
FAQ
Q: What is a UPRN?
A: A Unique Property Reference Number (UPRN) is a unique identifier for addressable locations in the UK. You can find yours at Find My Address.
Q: What is ntfy.sh?
A: ntfy.sh is a free, simple HTTP-based publish-subscribe notification service. It allows you to send notifications to your phone or desktop without setting up any accounts.
Q: How do I receive the notifications?
A: Download the ntfy app (Android, iOS), or use the web interface. Subscribe to your topic name.
Q: Does this work for areas outside Harlow?
A: No, this tool is specifically designed for the Harlow Local Authority website. Fork the project to adapt it for other regions.
Q: How accurate are the notifications?
A: The tool scrapes the official Harlow Council website, so the notifications are as accurate as the data provided by the council.
Architecture
Harlow Bindicator works by:
- Using ChromeDriver to open a headless browser session
- Navigating to the Harlow Council bin collection page
- Submitting the UPRN to retrieve collection information
- Parsing the returned data for upcoming collections
- Determining if a notification is needed based on the collection dates
- Sending a notification via ntfy.sh if a collection is scheduled within the specified timeframe
Contributing
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
- ntfy.sh for providing a simple notification service
- Selenium for web automation
- Harlow Council for providing the bin collection data
- All contributors who have helped improve this project
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file harlow_bindicator-3.1.1.tar.gz.
File metadata
- Download URL: harlow_bindicator-3.1.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ef4aa8d5e40e028adbbfc7d817aa1ebe01b3796e8741202df1d58fa0b3fac6f
|
|
| MD5 |
78f3ceccc32ff415dbf2b3656baffa4b
|
|
| BLAKE2b-256 |
0a90b97b2e14e3bef16a10e731be72db7a334c4d526c0ac9654423e954d4ae94
|
Provenance
The following attestation bundles were made for harlow_bindicator-3.1.1.tar.gz:
Publisher:
publish.yml on joe-mccarthy/harlow-bindicator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
harlow_bindicator-3.1.1.tar.gz -
Subject digest:
2ef4aa8d5e40e028adbbfc7d817aa1ebe01b3796e8741202df1d58fa0b3fac6f - Sigstore transparency entry: 258424325
- Sigstore integration time:
-
Permalink:
joe-mccarthy/harlow-bindicator@03fc587b74d047fce2bcf42f572121ba12f90043 -
Branch / Tag:
refs/tags/3.1.1 - Owner: https://github.com/joe-mccarthy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03fc587b74d047fce2bcf42f572121ba12f90043 -
Trigger Event:
push
-
Statement type:
File details
Details for the file harlow_bindicator-3.1.1-py3-none-any.whl.
File metadata
- Download URL: harlow_bindicator-3.1.1-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19bee1756e66c36fd28054b4923c1548c1cc348da3e83301fdd046f943f138d8
|
|
| MD5 |
a94d2a2ac64e6319a2fb7b74a5766f36
|
|
| BLAKE2b-256 |
4198dbad0d71f872bb8ef8677d7ab1c3b644efa25353d7156cae136c81cf8565
|
Provenance
The following attestation bundles were made for harlow_bindicator-3.1.1-py3-none-any.whl:
Publisher:
publish.yml on joe-mccarthy/harlow-bindicator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
harlow_bindicator-3.1.1-py3-none-any.whl -
Subject digest:
19bee1756e66c36fd28054b4923c1548c1cc348da3e83301fdd046f943f138d8 - Sigstore transparency entry: 258424358
- Sigstore integration time:
-
Permalink:
joe-mccarthy/harlow-bindicator@03fc587b74d047fce2bcf42f572121ba12f90043 -
Branch / Tag:
refs/tags/3.1.1 - Owner: https://github.com/joe-mccarthy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03fc587b74d047fce2bcf42f572121ba12f90043 -
Trigger Event:
push
-
Statement type: