pcomputo / Whole-Foods-Delivery-Slot

Automated script for Whole Foods and Amazon Fresh delivery slot
Apache License 2.0
443 stars 152 forks source link

New slot pattern #8

Closed StarWindMoonCloud closed 4 years ago

StarWindMoonCloud commented 4 years ago

Today I got "2-hour delivery windows", which is not included, looks like there might be "1-hour delivery windows" as well

StarWindMoonCloud commented 4 years ago

I was about to create pr but no permission

pcomputo commented 4 years ago

I've created an open repository. Not sure how to resolve the the PR issue. Certain links online ask you to create a PR on the GitHub UI. Maybe that can help.

Also, can you describe the problem more? Were you running the script when you got the slot? If you were did it still keep refreshing after a slot opened?

mp42244 commented 4 years ago

seem like a slot opened up

SLOTS OPEN! sh: 1: say: not found NO SLOTS!

but i wasnt alerted via a sounds. speaker volume is up and working. How can i test that the script is able to create sounds on my workstation?

pcomputo commented 4 years ago

instead of os.system('say "Slots for delivery opened!"') say os.system('spd-say "Slots for delivery opened!"'). for this to work you will need sudo apt install speech-dispatcher

mp42244 commented 4 years ago

Thank you

On Apr 4, 2020, at 1:32 PM, Pooja Ahuja notifications@github.com wrote:

instead of os.system('say "Slots for delivery opened!"') say 'os.system('spd-say "Slots for delivery opened!"')'. for this to work you will need sudo apt install speech-dispatcher

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

mp42244 commented 4 years ago

its not working. i get:

SLOTS OPEN! sh: 1: say: not found

On Sat, Apr 4, 2020 at 2:17 PM Matt Pocchia matthewpocchia@gmail.com wrote:

Thank you

On Apr 4, 2020, at 1:32 PM, Pooja Ahuja notifications@github.com wrote:

instead of os.system('say "Slots for delivery opened!"') say 'os.system('spd-say "Slots for delivery opened!"')'. for this to work you will need sudo apt install speech-dispatcher

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pcomputo/Whole-Foods-Delivery-Slot/issues/8#issuecomment-609062814, or unsubscribe https://github.com/notifications/unsubscribe-auth/APBIDGAMGY2X4G76GRQ6JQLRK5VKZANCNFSM4L6K6FEA .

pcomputo commented 4 years ago

did you do this in the python script and save it:

instead of os.system('say "Slots for delivery opened!"') say os.system('spd-say "Slots for delivery opened!"'). for this to work you will need sudo apt install speech-dispatcher

mp42244 commented 4 years ago

Yes I did both

On Apr 4, 2020, at 5:21 PM, Pooja Ahuja notifications@github.com wrote:

did you do this in the python script and save it:

instead of os.system('say "Slots for delivery opened!"') say os.system('spd-say "Slots for delivery opened!"'). for this to work you will need sudo apt install speech-dispatcher

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

pcomputo commented 4 years ago
import os
duration = 1  # seconds
freq = 440  # Hz
os.system('play -nq -t alsa synth {} sine {}'.format(duration, freq))

sudo apt install sox

remove any line that has os.system

mp42244 commented 4 years ago

Thank you

On Apr 4, 2020, at 6:08 PM, Pooja Ahuja notifications@github.com wrote:

import os duration = 1 # seconds freq = 440 # Hz os.system('play -nq -t alsa synth {} sine {}'.format(duration, freq)) sudo apt install sox

remove any line that has os.system

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

StarWindMoonCloud commented 4 years ago

Also, can you describe the problem more? Were you running the script when you got the slot? If you were did it still keep refreshing after a slot opened?

Here comes the error remote: Permission to pcomputo/Whole-Foods-Delivery-Slot.git denied to StarWindMoonCloud. fatal: unable to access 'https://github.com/pcomputo/Whole-Foods-Delivery-Slot.git/': The requested URL returned error: 403

pcomputo commented 4 years ago

Not really sure. I saw someone make a PR. So I think there is nothing wrong from my end.

I was wondering can you please describe

Today I got "2-hour delivery windows", which is not included, looks like there might be "1-hour delivery windows" as well

In more detail? I think the script works with 1 hour as well. It is independent of the hour duration actually. Were you running the script when you didn't get notified for an open slot?

StarWindMoonCloud commented 4 years ago

Not really sure. I saw someone make a PR. So I think there is nothing wrong from my end.

I was wondering can you please describe

Today I got "2-hour delivery windows", which is not included, looks like there might be "1-hour delivery windows" as well

In more detail? I think the script works with 1 hour as well. It is independent of the hour duration actually. Were you running the script when you didn't get notified for an open slot?

What you said is right, I didn't get notified. I'll try to post some HTML next time

pcomputo commented 4 years ago

Awesome! Thank you, that'll be really helpful.

pcomputo commented 4 years ago

hey was this about the Whole Foods script of the Amazon Fresh?

tangerinehuge commented 4 years ago

It looks like you were expecting the "continue" statements to keep executing the rest of the code but they actually return control to the beginning of the while loop. For instance, this block will either sleep for 1400 seconds if successful or skip back to the beginning of the loop if the exception is caught. This means the rest of your code is unreachable. The "pass" keyword is most likely what you want to use instead of "continue" although I'm not sure what impact that will have on the code.

  try:
     next_slot_text = soup.find('h4', class_ ='ufss-slotgroup-heading-text a-text-normal').text
     if slot_pattern in next_slot_text:
        print('SLOTS OPEN!')
        os.system('say "Slots for delivery opened!"')
        no_open_slots = False
        time.sleep(1400)
  except AttributeError:
     continue
StarWindMoonCloud commented 4 years ago

@pcomputo pull request created: https://github.com/pcomputo/Whole-Foods-Delivery-Slot/pull/15