Skip to content

Check delivery slots of albert heijn, and post results to slack channel

Notifications You must be signed in to change notification settings

lgylym/ah-delivery-checker

Repository files navigation

AH Delivery Checker checks AH website and post available delivery slots to a slack channel via slack webhook. It uses playwright to visit the website and get relevant cookies, before issuing the api call.

Run locally

To run locally, use the following command and replace the environment variables with yours:

docker build -t ah-checker .
docker run -it -e SLACK_WEB_HOOK=https://hooks.slack.com/services/foobar \
    -p 8080:8080 -e "SLACK_CHANNEL=#random" -e POSTCODE=1234AB -e HOUSENUMBER=101 ah-checker

In another shell, simply issue a GET request:

curl http://127.0.0.1:8080

Then you'll receive the available slots in your slack channel.

Run in Google Cloud Run

Here's my setup for Cloud Run:

  • Run the container as a Cloud Run service
  • Use Cloud Scheduler to trigger Cloud Run every 10 minutes

Note that the Cloud Run container needs 2GB memory to run.

Reference: https://cloud.google.com/run/docs/triggering/using-scheduler

About

Check delivery slots of albert heijn, and post results to slack channel

Topics

Resources

Stars

Watchers

Forks

Languages