drewhershey / italian-consulate-website-automation

2 stars 2 forks source link

Twilio support #1

Open plasticbugs opened 2 years ago

plasticbugs commented 2 years ago

Hi there! I forked your repo and added Twilio support (and a short pause between tries) so I could get an SMS when the script reaches the booking page. It's working perfectly, so thank you for doing all the heavy lifting here.

My fork is here: https://github.com/plasticbugs/italian-consulate-website-automation

I'd love to know if this script eventually helped you book an appointment. Also, do you have any tips to share beyond running this script all day. I'm only doing one tab. But I guess I can use the script to do multiple tabs during the crazy appointment release that happens once per day.

I'm not sure which of the two citizenship links it should be clicking to pick up a canceled appointment. Do you know? I assume the first CITIZENSHIP one of the two here. Is that right?

Screen Shot 2022-09-22 at 9 43 01 AM

Thanks again for this script! 🤞 that it helps me get an appointment before the next century. 🙇

drewhershey commented 2 years ago

I actually wrote this to help a non-programmer friend in his multi-year quest to complete the citizenship by descent process after he described how difficult it was to get through to the booking page, so it's cool to hear others might find it useful as well.

Out of curiosity, were you just searching to see if anyone else had attempted this sort of thing already and stumbled upon this repo?


I'd love to know if this script eventually helped you book an appointment.

I don't believe that it ever ended up actually working for him. He did tell me that he got the "success" email at one point, but by the time he got to his computer something had gone wrong. The primary reason I stopped working on the project was that it was just hard to troubleshoot/iterate past this point when I wasn't seeing the results of the code myself.

Also, do you have any tips to share beyond running this script all day

I think he generally started running the script 15 - 30 minutes before the time that new appointments would be posted and let it go for several hours. I'm not really sure if there'd be a point in running it around the clock. My only understanding of the internals of the system came from what my friend relayed to me based on info he'd gathered from others, so we were mostly just stumbling around in the dark.

I'm only doing one tab. But I guess I can use the script to do multiple tabs during the crazy appointment release that happens once per day.

I added the multiple-tab functionality just in hopes that more attempts being made at once would increase the likelihood of one getting through to the booking page, but I have no idea if it actually helps haha. Could easily just be making things worse.

I'm not sure which of the two citizenship links it should be clicking to pick up a canceled appointment. Do you know? I assume the first CITIZENSHIP one of the two here. Is that right?

I'm not sure, unfortunately. We were using the Houston, TX consulate location in our testing and they only had a single booking link for "citizenship by descent". I suppose you could modify the code to have it attempt both links simultaneously in separate tabs. The "2025/2027" text in the second link's description makes me think it's to allow people to book years into the future or something?


Hopefully since you're both using it and coding it yourself you'll be able to get further than I did. Let me know if there's anything I might be able to help figure out.

plasticbugs commented 2 years ago

I actually wrote this to help a non-programmer friend in his multi-year quest to complete the citizenship by descent process after he described how difficult it was to get through to the booking page, so it's cool to hear others might find it useful as well.

It's been super helpful and I'm hopeful that it will make booking an appointment less stressful. I'd much prefer puppeteer do the work than me!

Out of curiosity, were you just searching to see if anyone else had attempted this sort of thing already and stumbled upon this repo?

Exactly that. I started to script some simple browser interactions to automate all the button clicking and figured I should see if anyone had done something similar for the same website. I literally searched GitHub for "Italian Consulate" and was shocked to see you had already done nearly everything I was hoping to implement. 🙇

I think he generally started running the script 15 - 30 minutes before the time that new appointments would be posted and let it go for several hours. I'm not really sure if there'd be a point in running it around the clock.

I only have random comments in a reddit subforum to go off of but it seems like the consulate randomly releases near-future appointments when folks cancel their appointment for various reasons, so I'm really hoping to score one of those canceled slots.

The "2025/2027" text in the second link's description makes me think it's to allow people to book years into the future or something?

Yep, that's the link that they use for the once-daily release of appointments that are well into the future. I'm unsure if I should use that same link for the recently canceled slots. I guess it couldn't hurt to run against both links simultaneously!

Hopefully since you're both using it and coding it yourself you'll be able to get further than I did. Let me know if there's anything I might be able to help figure out.

Thank you so much for all this extra information and the offer of help! Since I'm running the script indefinitely, the browser session expires every 20 minutes or so, so I've updated it to log back in whenever it finds itself back at the login page unexpectedly.

If your friend still hasn't booked an appointment, he could try what I'm doing by attempting to get a freed up slot by running the script during off-hours and using SMS instead of email for the alert. The Twilio setup was super-easy and they start you off with plenty of credits for this use.