/vaccimailer

Primary LanguageJavaScriptMIT LicenseMIT

Vaccimailer

Never miss covid vaccination opportunity

Vaccimailer emails you when vaccination is available at a given pincode.

GitHub last commit GitHub issues GitHub repo size

Tech-Stack

NodeJS 

Installation

Install the dependencies and devDependencies and start the server.

git clone https://github.com/TheNinza/vaccimailer.git
cd vaccinator
npm install

For running the application

In index.js, find and modify pin code at line 39.

const pincode = "YOUR_PIN_CODE";

Also you can look for a particular date by modifying vaccinationDate string at line 43 in DD-MM-YYYY format. By default, it checks for the next day availabilities.

const vaccinationDate = "DD-MM-YYYY";

Make sure to set your emails and passwords.

For gmail, you have to create an App-Password to allow sending email on your behalf. You can crete an app password by visiting this link.

const transporter = nodemailer.createTransport({
  service: "gmail",
  auth: {
    user: process.env.GMAIL_EMAIL,
    pass: process.env.GMAIL_PASS,
  },
});

const sendEmail = (text) => {
  transporter.sendMail(
    {
      from: process.env.GMAIL_EMAIL,
      to: process.env.GMAIL_EMAIL_REC,
      subject: "Cowin available",
      text,
    },
    (err, info) => {
      if (err) {
        console.log(err);
      } else {
        console.log(info);
      }
    }
  );
};

From your shell, run

npm start

It also sends the json for available slots on

127.0.0.1:8000

Alternatively you can use docker. To build and run the image run the following 2 commands:

docker build -t vaccimailer . --no-cache
docker run --rm -d -p 8000:8000 --name vaccimailer vaccimailer

Development

Want to contribute? Great! Do check issues section.

License

MIT

Stay Safe