Socket
Socket
Sign inDemoInstall

cowinator

Package Overview
Dependencies
82
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cowinator

This is the package to get Cowin slots and stats by state/district.


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

CoWin-ator

This is the package to get Cowin slots and stats by state/district.

Please refer API Documentation here.

NPM

Installation

Install using 'npm'

npm i cowinator

Install using 'yarn'

yarn add cowinator

Development Usage

import { Cowinator } from "cowinator";

const client = new Cowinator();

// List of states having state_id and state_name
client.getStates().then((states) => {
  console.log(states);
});

// List of districts having district_id and district_name
const state_id = 2; // state_d:2 for 'Andhra Pradesh'
client.getDistricts(state_id).then((districts) => {
  console.log(districts);
});

// Get stats for specified state
client.getStatsByState(state_id).then((stats) => {
  console.log(stats);
});

const district_id = 571; // district_id:571 for 'Chennai'
// Get stats for specified state
client.getStatsByDistrict(district_id).then((stats) => {
  console.log(stats);
});

// Get list of sessions for a district
client.findByDistrict(district_id).then((sessions) => {
  console.log(sessions);
});

// Find state_id by search string
client.findStateByName("tamil").then((matchedState) => {
  console.log(matchedState); // Will get state_id and state_name for 'tamil nadu'
});

// Find state_id by search string
client.findDistrictByName(state_id, "east").then((matchedDistrict) => {
  console.log(matchedDistrict); // Will get district_id and district_name for 'East Godavari'
});

CLI

We can use this package in CLI.

Install for CLI

npm i -g cowinator

CLI Usage

To get the stats for a state

cowinator andhra

To get the stats for a particular district in a state

cowinator "tamil nadu" --district chennai

To post the stats to the telegram channel.

Note: Please assign your bot token to 'TELEGRAM_BOT_TOKEN' as environment variable.

cowinator "tamil nadu" --district chennai --tgChannel "@channelname"

Keywords

FAQs

Last updated on 23 May 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc