Amazon-Fresh-Whole-Foods-delivery-slot-finder icon indicating copy to clipboard operation
Amazon-Fresh-Whole-Foods-delivery-slot-finder copied to clipboard

Add support for Prime Now

Open jazaval opened this issue 4 years ago • 5 comments

This PR:

  • Adds support for Prime Now orders from any merchant - Whole Foods, Amazon, Bartell Drugs, etc.

How:

  1. Each Prime Now merchant has a specific merchantId in the slot delivery page URL that is populated once you click "Proceed to checkout" from the generic cart URL at https://primenow.amazon.com/cart.
  2. I added an if statement enabling restartCheckout to click the "Proceed to checkout" button, which then sets the variable prime_now_merchant_specific_slot_url to the custom, merchant-specific URL that contains the available slot listings (example: https://primenow.amazon.com/checkout/enter-checkout?merchantId=A7D2T2JJFZOBQ&ref=pn_sc_ptc_bwr)
  3. The subsequent runs of the main loop then use prime_now_merchant_specific_slot_url instead slot_site_url and the delivery slot parsing works as expected.

jazaval avatar Apr 11 '20 22:04 jazaval

Worked for me!

Merculis avatar Apr 13 '20 05:04 Merculis

Worked for me, too. Thank you!

awu1004 avatar Apr 13 '20 17:04 awu1004

@ahertel any ETA on this? It would be great to have this in the upstream repository.

americanhanko avatar Apr 15 '20 02:04 americanhanko

@jazaval I just tried this out on a macbook and it mostly worked as expected. After a refresh I happened to be near the laptop for it was displaying a new delivery slot, but for some reason the script didn't trigger any sound or notification of the new slot. Does the script take an additional refresh of the page with the same slot showing to notify the user? Just pointing this out in case it's unintended behaviour due to these prime now support changes.

nikkiam avatar Apr 16 '20 21:04 nikkiam

@nikkiam this is an expected behavior, but only if there's a slot available in the very first loop of the script. This is a side effect of using the restartCheckout function to obtain the correct merchantID for the cart, which only happens at the end of the first loop.

jazaval avatar Apr 16 '20 21:04 jazaval