Skip to content

Instantly share code, notes, and snippets.

@sahilbathla
Created May 10, 2021 18:36
Show Gist options
  • Select an option

  • Save sahilbathla/7cfc5401d5c1d88642f7ba7b0808e352 to your computer and use it in GitHub Desktop.

Select an option

Save sahilbathla/7cfc5401d5c1d88642f7ba7b0808e352 to your computer and use it in GitHub Desktop.
Cowin book (Web)
//This script will auto select a vaccination in Delhi center only, To use login to https://selfregistration.cowin.gov.in/appointment and select state as Delhi, Leave District empty and run this script in developer console of your browser. Sit & wait till it finds a slot
let district=-1,seatSelect=()=>setTimeout(()=>(console.log("trying to select seat")||document.querySelectorAll(".slots-box:not(.no-seat):not(.no-available)")[0]?document.querySelectorAll(".slots-box:not(.no-seat):not(.no-available)")[0].click():play())||setTimeout(()=>document.getElementsByClassName("time-slot")[0].click(),1500),2e3),play=()=>(district=(district+1)%11)&document.querySelector(".pin-search .mat-select-arrow").click()||setTimeout(()=>document.querySelectorAll("mat-option")[district].click()||document.querySelector(".pin-search-btn").click()||setTimeout(()=>document.querySelector(".agefilterblock div label").click()||seatSelect(),2500),300);play(),console.log("[email protected]");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment