Git Product home page Git Product logo

cowin_slotter's Introduction

CoWin_slotter

A simple script which can alert a Mac OS user for available slots for COVID-19 vaccination through the CoWin api. Contains a callable script that can be setup as a cron job on Mac / Linux based systems to alert the user at any time. Can also be used in Windows with some changes.

Requirements (Mac)

  • Python 3.x version installed on your macbook.
  • newman installed through node package manager (npm)
  • osascript utility installed (usually by default) on Mac

Setup

  • Install python using homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

brew install python

  • Next, install npm (node package manager)

https://nodejs.org/en/download/

  • Install the npm package newman, This package provides the ability to fetch availability status from CoWin :

sudo npm -g install newman

  • Clone the repo on git:

git clone https://github.com/shaansharma1980/CoWin_slotter.git

Usage

chmod +x cowin_notifier.bash

./cowin_notifier.bash

The above command will show an alert as below:

GitHub Logo

Add to a cronjob to run it every 30 minutes

crontab -e

Paste the line below at the end of the editor with a CTRL + V

30 * * * * /home/$USER/cowin_notifier.bash

Type :q! to exit the editor.

Thats it !

How it works

  • newman is an npm package which provides postman type curl capabilities. It is used to get results from the CoWin api.
  • cowin_notifier.py reads the dump of the vaccination data from a tmp file and formats it to call osascript utility.
  • osascript is used to display the notification to the mac user (it is available by default on mac)
    • osascript -e 'display notification "Message" with title "Title"'

Contributions

  • This is free software and if anyone would like to extend it to help create further improvements, please feel free to do so !
  • Please ensure that your sole purpose is to help the Indian people in getting vaccination slots across India.
  • Do not overload the api with HTTP requests ! Be nice and let others use it judiciously, put a pragmatic time interval between fetches.

cowin_slotter's People

Contributors

shaansharma1980 avatar

Watchers

 avatar

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.