Skip to content

Instantly share code, notes, and snippets.

@sassygrody
Created March 31, 2021 17:12
Show Gist options
  • Save sassygrody/fe5b56a5b36e282781ac4ad1a4021a4d to your computer and use it in GitHub Desktop.
Save sassygrody/fe5b56a5b36e282781ac4ad1a4021a4d to your computer and use it in GitHub Desktop.

Hello! This is a Javascript script that can be used to search Walgreens.com for an availability for the first dose appointment. To use the script as a Browser bookmark, follow these steps:

  1. Create a new bookmark in the bookmarks bar of your browser
  2. The bookmark title can be whatever, like “Search Walgreens”
  3. The URL has to be this (copy and paste the content below starting at "javascript:" ):
javascript: (function () { var timeout; function playLoudBeep() { var audio = new Audio( "https://media.geeksforgeeks.org/wp-content/uploads/20190531135120/beep.mp3" ); audio.play(); } function clickSearchButton() { var content = document.body.textContent || document.body.innerText; var isInitialSearchByZip = content.indexOf( "Let's check COVID-19 vaccine availability in your area." ) !== -1; var button; if (isInitialSearchByZip) { button = document .getElementsByClassName("LocationSearch_container")[0] .getElementsByClassName("btn")[0]; } else { button = document.getElementsByClassName("icon__search")[1]; } if (appointmentFound()) { playLoudBeep(); stopClickingButton(); return; } if (button) { button.click(); } timeout = setTimeout(clickSearchButton, 5000); } function startSearching() { clickSearchButton(); } function stopClickingButton() { clearTimeout(timeout); } function appointmentFound() { var content = document.body.textContent || document.body.innerText; var noAppointmentText = "We don't have any available appointments"; var noAppointmentTextIsGone = content.indexOf(noAppointmentText) === -1; return noAppointmentTextIsGone; } startSearching(); })();
  1. Save the bookmark
  2. Go to Walgreens.com and start the scheduling process
  3. You must do the initial zip code search manually and then fill out the screening questionnaire
  4. You will eventually get to the page titled “Schedule Dose 1" 
  5. Once on that page, if there are no available appointments, click once on your new bookmark
  6. The page will automatically start searching (you will see a spinning icon every time it searches)
  7. When an availability is found, the browser will stop searching and a loud "BEEP" sound will play. (sorry that the sound is so loud)
@jgrodzin
Copy link

Good instructions!

Thanks for the search routine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment