Git Product home page Git Product logo

covaccine-notifier's Introduction

covaccine-notifier

CoWIN Portal Vaccine availability notifier

covaccine-notifier periodically checks and sends email notifications for available slots for the next 7 days on CoWIN portal in a given area and age.

Sample screenshot

email notification

Installation

Install the pre-compiled binary

curl -sfL https://raw.githubusercontent.com/PrasadG193/covaccine-notifier/main/install.sh | sh

Docker

docker pull ghcr.io/prasadg193/covaccine-notifier:v0.2.0

Usage

covaccine-notifier can monitor vaccine availability either by pin-code or state and district names

$ ./covaccine-notifier --help
CoWIN Vaccine availability notifier India

Usage:
  covaccine-notifier [command]

Available Commands:
  email       Notify slots availability using Email
  help        Help about any command
  telegram    Notify slots availability using Telegram

Flags:
  -a, --age int            Search appointment for age (required)
  -d, --district string    Search by district name
  -o, --dose int           Dose preference - 1 or 2. Default: 0 (both)
  -f, --fee string         Fee preferences - free (or) paid. Default: No preference
  -h, --help               help for covaccine-notifier
  -i, --interval int       Interval to repeat the search. Default: (60) second
  -m, --min-capacity int   Filter by minimum vaccination capacity. Default: (1)
  -c, --pincode string     Search by pin code
  -s, --state string       Search by state name
  -v, --vaccine string     Vaccine preferences - covishield (or) covaxin. Default: No preference

Use "covaccine-notifier [command] --help" for more information about a command.

example

$ ./covaccine-notifier email --help 

Note: Gmail password won't work for 2FA enabled accounts. Follow this guide to generate app token password and use it with --password arg

Integration with Telegram

For telegram bot integration with covaccine-notifier follow this.

Integration with Mattermost

For mattermost integration refer this document

Examples

Terminal

Search by State and District

covaccine-notifier email --state Maharashtra --district Akola --age 27  --username <email-id> --password <email-password>

Search by Pin Code

covaccine-notifier email --pincode 444002 --age 27  --username <email-id> --password <email-password>

Enable Telegram Notification

covaccine-notifier telegram --pincode 444002 --age 27 --token <telegram-token> --username <telegram-username>

Enable mattermost notification

covaccine-notifier mattermost --pincode 444002 --age 27 --token <mattermost-bot-token> --username <mattermost-user-to-sent-messages> --url <mattermost-server-url>

Docker

docker run --rm -ti ghcr.io/prasadg193/covaccine-notifier:v0.2.0  email --state Maharashtra --district Akola --age 27  --username <email-id> --password <email-password>

Running on Kubernetes Cluster

If you are not willing to keep your terminal on all the time ๐Ÿ˜„, you can also create a Pod on K8s cluster

kubectl run covaccine-notifier --image=ghcr.io/prasadg193/covaccine-notifier:v0.2.0 --command -- /covaccine-notifier email --state Maharashtra --district Akola --age 27  --username <email-id> --password <email-password>

Contributing

We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:

  • Reporting a bug
  • Discussing the current state of the code
  • Submitting a fix
  • Proposing new features

covaccine-notifier's People

Contributors

frezbo avatar prasadg193 avatar shakti-garg avatar shreyas-sriram avatar sohm22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

covaccine-notifier's Issues

Connection reset by peer

Logs

2021/05/11 20:42:20 Received unexpected response, rechecking after 60 seconds
2021/05/11 20:43:20 Querying endpoint: https://cdn-api.co-vin.in/api/v2/appointment/sessions/calendarByDistrict?district_id=294&date=11-05-2021
Error: Failed to fetch appointment sessions: Get "https://cdn-api.co-vin.in/api/v2/appointment/sessions/calendarByDistrict?district_id=294&date=11-05-2021": read tcp 172.31.32.42:47126->54.182.0.86:443: read: connection reset by peer
Usage:
  covaccine-notifier [FLAGS] [flags]

Flags:
  -a, --age int           Search appointment for age
  -d, --district string   Search by district name
...
...

Daily email digest

Apologies if its already there.

Could it send a daily ( or every 12 h ) digest just to let the user know that its still looking ( the process has not died )

Example

Hey am still looking 7 times a minute for an appointment
I looked 999 times today for PIN XXXXXX & PIN XXXXXX
I failed 3 times today
I have been looking since 1-4-2021

Useful when the email-alert is processed using a forwarding rule and sent to other people who may not know if the process is still running. This reduces their anxiety by letting them know that covaccine-notifier is still working diligently somewhere up in the cloud.

Oh, and the ability to search for multiple PIN codes would be nice. Currently running two processes with custom update intervals.

Example https://github.com/sinhadotabhinav/covid-19-vaccine-alerts-cowin

Option for number of days to check

An option to specify a number for days to check availability for.
For example, --days 15 will check available slots for the next 15 days.

Avoiding HTTP Error 403

I was getting this error after ~1 hour
Error: Failed to fetch appointment sessions: Request failed with statusCode: 403

Use of restricted API

You are using restricted api for checking the session.
Make sure you are using PUBLIC endpoints.

Option - Narrow down search criteria by center_id

Ability to narrow down the search criteria by one or two center IDs would be useful.

Example

covaccine-notifier --state Maharashtra --district Akola --age 27 --email <email-id> --password <email-password>

A district wide search for district_id=364 results in 42 centers....
This query results in a flood of email alerts every time a slot opens up.

I just care about center_id:614986 , its just down the road. The alerts for those 41 other centers in my district just result in notification-fatigue :)

Invalid state name

When i am providing West Bengal as the state name its giving invalid name where as in the response same name has been mentioned.

Got stuck at docker

after the second step in the readme...
docker pull ghcr.io/prasadg193/covaccine-notifier:latest

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

question

what the frequency of the checks made?

Getting error while sending the email

Got following error :

2021/05/10 04:51:34 Found available slots, sending email
Error: 535 5.7.8 Username and Password not accepted. Learn more at
5.7.8  https://support.google.com/mail/?p=BadCredentials d63sm18304741pjk.10 - gsmtp
Usage:
  covaccine-notifier [FLAGS] [flags]

Error: json: cannot unmarshal number 32.5 into Go struct field .centers.sessions.available_capacity of type int

โฏ ./covaccine-notifier -c 452001 -a 60 -e [email protected] -p xyz
Error: json: cannot unmarshal number 32.5 into Go struct field .centers.sessions.available_capacity of type int
Usage:
covaccine-notifier [FLAGS] [flags]

Flags:
-a, --age int Search appointment for age
-d, --district string Search by district name
-e, --email string Email address to send notifications
-h, --help help for covaccine-notifier
-p, --password string Email ID password for auth
-c, --pincode string Search by pin code
-s, --state string Search by state name

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.