Skip to content

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

License

Notifications You must be signed in to change notification settings

TheNinza/vaccimailer

Repository files navigation

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

You can look for a particular date by modifying vaccinationDate value at line 42 to 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, send_to) => {
  transporter.sendMail(
    {
      from: process.env.GMAIL_EMAIL,
      to: send_to,
      subject: "Cowin available",
      text,
    },
    (err, info) => {
      if (err) {
        console.log(err);
      } else {
        console.log(info);
      }
    }
  );
};

From your shell, run

npm start

To input the email address (EMAIL) and pincode (PINCODE) to assign the listener, use the following endpoint:

http://localhost:PORT/subscribe?pincode=PINCODE&email=EMAIL

To get a list of all active listeners, use the following endpoint:

http://localhost:PORT/all

To unsubscribe and remove listener, use the following endpoint:

http://localhost:PORT/unsubscribe?email=EMAIL

The json for available slots is sent 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

Additionally, a user friendly front-end has been added which fetches data from the local server and displays the information as follows:

Data

Error

Development

Want to contribute? Great! Do check issues section.

License

MIT

Stay Safe

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published