mark-thompson / whole-foods-deliverance

[Availability notifications, auto-checkout, slot preferences, cart tracking] for Whole Foods / Amazon Fresh
MIT License
53 stars 12 forks source link
amazon amazon-fresh grocery-delivery selenium-python telegram twilio whole-foods

whole-foods-deliverance

Enhancing the Whole Foods / Amazon Fresh delivery experience.

Features:

Description

Born out of frustration with the perennially unavailable Whole Foods / Amazon Fresh delivery slot, this is a simple script that uses an automated browser (Selenium) to navigate to your cart and refresh the delivery slot selection page until there is an opening. When a slot is found, a friendly voice emanates from your speakers informing you of your good fortune.

If called with the --checkout flag, the program will also attempt to select a slot for you and checkout automatically.

Optionally, you can choose to be notified via SMS (Twilio) and/or Telegram by supplying API credentials in conf.toml.

More on these services here:

Requirements

Installation

Optional

Do this if you want to send SMS/Telegram notifications or specify delivery slot preferences

Note

The default requirements assume you are using the current stable version of Chrome (version 81). If you are using a beta or dev release (version 82+) and you get an error when running the script, run:

pip install --upgrade chromedriver-binary

If you are still using Chrome version 80, run:

pip install --upgrade chromedriver-binary==80.0.3987.106.0

Usage

Run the script with the default options:

python run.py

Or specify one or more options to change the script behavior. e.g.:

python run.py -s 'Amazon Fresh' --checkout --ignore-oos --debug

Options

Service

Specify the delivery service you are using with the -s or --service option. Quotes are required.

Defaults to: 'Whole Foods'

python run.py -s 'Amazon Fresh'

Checkout

Use the -c or --checkout flag to attempt to checkout automatically when a slot is found. Uses your delivery window preferences as specified in conf.toml under the slot_preference key. _See: config template_

python run.py --checkout

Ignore-OOS

At some point, you may encounter an out of stock alert. By default, the program will produce an audio alert and give you some time to continue through the alert prompt if you've decided the item in question isn't essential to your order.

Use the --ignore-oos flag if you'd like to bypass these alerts automatically. Details of the removed items will be saved to a local file: removed_items_{timestamp}.toml

python run.py --ignore-oos

Save-Cart

Occasionally (and rather unhelpfully), items will disappear from your cart without generating any kind of alert. Use the --save-cart flag to write a local file containing all of your cart items before the slot search begins.

python run.py --save-cart

Debug

Among other things, the --debug flag will save the current page source if a Selenium error is encountered. Use this if you are getting an error and want to help contribute to a fix

python run.py --debug

Inspiration credit: this much more interestingly named project