wheeliefreshbins/README.md

93 lines
2.7 KiB
Markdown
Raw Normal View History

2023-08-07 18:08:30 +01:00
# Wheelie Fresh Bins cleaning schedule retrieval
## Overview
`schedule.py` is a Python script designed to retrieve the cleaning schedule
information from Wheelie Fresh Bins and save it as HTML and an ICS (iCalendar)
file. This tool automates the process of accessing your cleaning schedule and
provides you with easily accessible calendar data.
## Prerequisites
Before using this script, make sure you have the following prerequisites:
- Python 3
- Required Python modules: `ics`, `jinja2`, `lxml`, and `requests`.
- Playwright (used for headless web scraping).
## Installation
1. Clone or download this repository to your local machine.
2. Install the required Python modules by running:
```
pip install playwright lxml ics jinja2 requests
```
3. Make sure you have the Playwright dependencies installed for your platform.
You can follow the installation instructions for Playwright
[here](https://playwright.dev/python/docs/intro).
4. Customize the configuration in the `config` file to match your requirements.
## Usage
To use the script, run it from the command line:
```
python schedule.py
```
The script will log in to the Wheelie Fresh Bins website, retrieve your
cleaning schedule, and save it as an HTML file (`dest`) and an ICS file
(`ics_file`). The HTML file can be opened in a web browser, while the ICS file
can be imported into your favorite calendar application.
## Scheduling with Crontab
You can automate the execution of `schedule.py` by scheduling it to run once per
day using the crontab utility. Here's how to do it:
1. Edit your crontab file using the following command:
```
crontab -e
```
2. Add the following line to schedule the script to run daily at a specific
time. Replace `/path/to/schedule.py` with the actual path to your
`schedule.py` script:
```
0 0 * * * /usr/bin/python3 /path/to/schedule.py
```
This example schedules the script to run every day at midnight. You can
adjust the time and frequency according to your preferences. Save the crontab
file.
3. Crontab will automatically execute the script at the specified time each
day, and the schedule data will be updated accordingly.
## Customization
- You can customize the script's behavior by editing the configuration in the
`config` file, such as specifying your login credentials, file paths, and
other options.
- The script uses Jinja2 templates to render the HTML output. You can modify
the HTML template in the `templates` directory to change the appearance of
the schedule.
## Author
This script was created by Edward Betts (edward@4angle.com). Feel free to
contact me for support or improvements.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
for details.