Skip to content
This repository has been archived by the owner on Jan 3, 2022. It is now read-only.

Commit

Permalink
Improve readme and add validations
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavdc committed May 14, 2021
1 parent f03396d commit f517fc1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
5 changes: 4 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ function checkParams() {
console.error('Please provide your age by appending --age=<YOUR-AGE> \nRefer documentation for more details');
return;
} else if (!argv.district && !argv.pin) {
console.error('Please provide required district id by appending --district=<DISTRICT-ID> \nRefer documentation for more details');
console.error('Please provide either district-id or pincode by appending --district=<DISTRICT-ID> or --pin=<PINCODE> \nRefer documentation for more details');
return;
} else if (argv.pin && argv.pin.toString().length !== 6) {
console.error('Pincode must be a 6 digit number \nRefer documentation for more details');
return;
} else if (argv.interval && argv.interval < 5) {
console.error('Please provide an interval greater than 5 minutes');
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cowin-pinger",
"version": "1.0.1",
"version": "1.0.3",
"description": "Get notified on your phone when there is a vaccine slot available at your location, by running a script on your computer. Uses Cowin portal's public API.",
"main": "app.js",
"scripts": {
Expand All @@ -21,5 +21,14 @@
"bin": {
"cowin-pinger": "./app.js"
},
"keywords": ["cowin", "covid", "vaccine", "notification", "notifier", "automation", "script", "ifttt"]
"keywords": [
"cowin",
"covid",
"vaccine",
"notification",
"notifier",
"automation",
"script",
"ifttt"
]
}
6 changes: 4 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ Replace the arguments above with the required values like mentioned below

- Replace `<YOUR-AGE>` with your age.

Not required if used --pin
- Replace `<DISTRICT-ID>` with your district's id from this [list](#district_list).

Optional arguments accepted:

- Pass `--interval=<INTERVAL-IN-MINUTES>` to change the frequency of calling Cowin API (default is 15 mins).
- Pass `--appts=<APPOINTMENT-COUNT>` to specify the number of session details you want to receive in the notification (default is 2).
- Pass `--pin=<YOUR-AREA-PIN-CODE>` to get only notification about your pin code.
- Pass `--pin=<YOUR-AREA-PIN-CODE>` to search for availabe slots based on pin code. (`<DISTRICT-ID>` is not required and will be ignored if searching by PIN)

(Note: Search by District is recommended as searching by PINCODE will have lower chances of finding a slot)


## IFTTT Integration (Optional)
By integrating with [IFTTT](https://ifttt.com/) you can recieve the notification on your phone.
- ### Setting Up IFTTT
Expand Down

0 comments on commit f517fc1

Please sign in to comment.