Skip to content

Instantly share code, notes, and snippets.

@sassygrody
Last active April 1, 2021 17:26
Show Gist options
  • Save sassygrody/a7f3e7bb3f9b90392ae50a184b115eaf to your computer and use it in GitHub Desktop.
Save sassygrody/a7f3e7bb3f9b90392ae50a184b115eaf to your computer and use it in GitHub Desktop.
CVS Search Bookmark

Hello! This is a Javascript script that can be used to search CVS.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 CVS”
  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() { const button = document.getElementsByClassName("search-icon")[0]; if (appointmentFound()) { playLoudBeep(); stopClickingButton(); return; } if (button) { button.click(); } timeout = setTimeout(clickSearchButton, 3000); } function startSearching() { clickSearchButton(); } function stopClickingButton() { clearTimeout(timeout); } function appointmentFound() { var content = document.body.textContent || document.body.innerText; var foundApptText = "available vaccines found"; var foundApptTextIsShowing = content.indexOf(foundApptText) !== -1; return foundApptTextIsShowing; } startSearching(); })();
  1. Save the bookmark
  2. Go to CVS Vaccine Scheduler and start the scheduling process
  3. You must fill out the screeing form: select no, no, no and continue (selecting yes for any option will make you ineligible at this time)
  4. Continue filling out the form
  5. You will eventually arrive at a page titled "Schedule dose" with a zipcode search input
  6. Enter your zipcode (or a nearby accessible zipcode) and click search
  7. If there are no available appointments, click once on your new bookmark
  8. The page will automatically start searching (you will see a updated content every time it searches)
  9. When an availability is found, the browser will stop searching and a loud "BEEP" sound will play. (sorry that the sound is so loud)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment