This script logs in to the Park Slope Food Coop website using Selenium, and checks the calendar for available appointments. If any appointments are available, it sends a notification to a Discord webhook specified in the WEBHOOK environment variable.
pip install selenium)Before running the script, you need to set three environment variables:
WEBHOOK: The Discord webhook URL to send notifications toUSERNAME: Your Park Slope Food Coop login usernamePASSWORD: Your Park Slope Food Coop login passwordYou can set environment variables in your terminal session before running the script:
export WEBHOOK='https://discordapp.com/api/webhooks/...'
export USERNAME='your_username'
export PASSWORD='your_password'
Or, you can set them in your IDE or code editor's run configuration.
To run the script, navigate to the directory containing the script in your terminal, and enter:
python park_slope_food_coop.py
The script will launch Chrome, navigate to the login page, enter your username and password, and check the calendar for available appointments. If any appointments are available, it will send a notification to the Discord webhook URL specified in the WEBHOOK environment variable.
If all appointments are taken, the script will print a message indicating that there are no available appointments.
A Dockerfile is available for easy of automation. It sets up the Python environment, and runs the script on an hourly cron.
Content type
Image
Digest
sha256:2e32266e5…
Size
429.8 MB
Last updated
7 days ago
docker pull zarguell/coopscraper