ayushchd / cowin_js_bot

A script to help you book your vaccine slot faster
45 stars 20 forks source link

It searches for 7 times and then get stopped. #1

Closed darkQuanger closed 3 years ago

darkQuanger commented 3 years ago

It will be very helpful if you add infinite search request even if there no slot available.

ayushchd commented 3 years ago

I will try and add better support but for now you could do this:

var script = document.createElement('script');script.src = "https://cowin-bot.s3-eu-west-1.amazonaws.com/main.js";document.getElementsByTagName('head')[0].appendChild(script);
setInterval(() => go({
    state: "Delhi",
    districts: [], // leave untouched for all districts, for specific districts, replace [] with districts for e.g., ["North Delhi", "South Delhi"]
    age: "Age 18+", // "Age 18+", "Age 45+"
    vaccine: "Covaxin", // "Covaxin", "Covishield", leave blank for no pref
    type: "Frees", // "Paid", "Free", leave blank for no pref
    n: 1, // number of beneficiaries - centers with slots less than this value will not be considered eligible
    mode: 1, // 1 for find fist available slot and proceed to book appointment, 2 for just looking through each district quickly
    searchIntervalInSeconds: 0.3, // time the script will wait to search for the next district. Use lower value with mode 1. Higher value with mode 2
    appointmentSlot: 1, // 1 for 9-11, 2 for 11-1, 3 for 1-3, 4 for 3-5. Only applicable with mode 1
}), 25000)

It will run every 25s until slot is found (even the first run will start after 25s so you might have to wait a little)

Walkie913 commented 3 years ago

Script isnt working properly. Once i paste in the browser, nothing happens. Am i missing something

ayushchd commented 3 years ago

Are you on the scheduling page? Do you see an error?

darkQuanger commented 3 years ago

Yes, the script is not working anymore

darkQuanger commented 3 years ago

Thanks, its working now.

darkQuanger commented 3 years ago

is this normal to get these?

main.js:39 Uncaught (in promise) TypeError: Cannot read property 'trim' of undefined at HTMLSpanElement.<anonymous> (main.js:39) at Function.each (VM139 jquery-3.4.1.min.js:2) at k.fn.init.each (VM139 jquery-3.4.1.min.js:2) at go (main.js:38)

ayushchd commented 3 years ago

Did you change the districts? Can you paste the command/input you are running?

darkQuanger commented 3 years ago

Sure, here it is

var script = document.createElement('script');script.src = "https://cowin-bot.s3-eu-west-1.amazonaws.com/main.js";document.getElementsByTagName('head')[0].appendChild(script); setInterval(() => go({ state: "West Bengal", districts: "Kolkata", // leave untouched for all districts, for specific districts, replaceth districts for e.g., ["North Delhi", "South Delhi"] age: "Age 18+", // "Age 18+", "Age 45+" vaccine: "Covishield", // "Covaxin", "Covishield", leave blank for no pref type: "Paid", // "Paid", "Free", leave blank for no pref n: 1, // number of beneficiaries - centers with slots less than this value will not be considered eligible mode: 1, // 1 for find fist available slot and proceed to book appointment, 2 for just looking through each district quickly searchIntervalInSeconds: 0.3, // time the script will wait to search for the next district. Use lower value with mode 1. Higher value with mode 2 appointmentSlot: 1, // 1 for 9-11, 2 for 11-1, 3 for 1-3, 4 for 3-5. Only applicable with mode 1 }), 5000)

ayushchd commented 3 years ago

Use ["Kolkata"] instead of "Kolkata"

darkQuanger commented 3 years ago

Thanks

ayushchd commented 3 years ago

Great, let me know if it helped - I will be launching this as a chrome extension pretty soon.

darkQuanger commented 3 years ago

Sure.

darkQuanger commented 3 years ago

The portal is kicking off the user after 30 minutes. Anything to remain active?

ayushchd commented 3 years ago

Hey - sorry there's no way around that validation for now. I would suggest use this more aggressively when slots are likely to open up or when you see a ton of alerts coming in from of the alerting bots that people have made.

darkQuanger commented 3 years ago

No worries, the script is already very helpful. You have done a very good job.