ahertel/Amazon-Fresh-Whole-Foods-delivery-slot-finder

[Region expansion] - Slot pages w/ 3+ days

marciw opened this issue · 7 comments

Thank you for this script!

When I've looked for slots manually, occasionally they seem to open up 2 or 3 days out (instead of just on the current day). I'm going to try to work on a PR, but in the meantime I wanted to suggest this as a possible enhancement: Could the script check each day displayed on the page, instead of just the current day?

(PS: I'm using this with the "Reserve your time" variation, which shows more days than just today/tomorrow, so that's why I'd like to try all of them. I tweaked slot_page_keyword and no_slot_keyword to match my variation of the page, and it seems to work fine.)

I tried to get this working too by piggybacking on your clickClassName function and using the element indexes on the page for each day (for the UK the index were 9, 10, 11 and 12 for the 4 visible days), however, it didn't work for some reason. I think there may have been something wrong with the scoping and the way I was invoking Safari with tell application.

Either way, one thing is certain for both this and the out of stock handling you've already written, "Allow Javascript from Apple Events" must be enabled from the Develop Menu in Safari for any javascript to be allowed to run from AppleScript.

@marciw What did you end up setting slot_page_keyword to?

(PS: I'm using this with the "Reserve your time" variation, which shows more days than just today/tomorrow, so that's why I'd like to try all of them. I tweaked slot_page_keyword and no_slot_keyword to match my variation of the page, and it seems to work fine.)

@ahertel i managed to add checks for multiple days. if you'd like I can do a PR. or I can share my script here.

it's for NYC Fresh.

Here's the screen in play:
nyc fresh multiple days check

@yinhowlew I have the same NYC fresh, can you please share your working script? Appreciated it!

@yinhowlew a PR would be great so people can publicly see that you helped out with this project . But whatever you prefer really. looking forward to reading which approach you took. I didn't get around to working on this myself yet so I appreciate you going for it!

@ahertel I added a PR - do check if it makes sense to you, since I am kinda new to this Apple Script thing. I basically just clicked on the next few days, and added separate siteTexts, then process them altogether rather manually.

I only updated the .scpt file btw.

@bluerainsky you can checked out the PR I submitted and see if things make sense for you. Thanks!

@RichMendes Just "Reserve your time"

@marciw What did you end up setting slot_page_keyword to?