This repo is a fork. Checkout NovelCovid API for the official documentation.
This library runs along side of your NodeJS project. This library doesn't serve API's, it only scrapes and saves the data to redis. Useful if you want to get the data from Redis directly
yarn add novelcovid-scraper
or
npm install novelcovid-scraper
const { setConfig, startFetch } = require('novelcovid-scraper');
setConfig({
interval: '*/10 * * * *', // Optional: Default (*/10 * * * *) Every 10 mins
nyt_interval: '0 * * * *', // Optional: Default (0 * * * *) Every hour
redis: {
host: "localhost", // Mandatory
password: "", // Mandatory
port: "6379" // Mandatory
}
});
interval
denotes the frequency of fetching data from Worldometer and JHUnyt_interval
denotes the frequency of fetching data from nytimes- Redis parameters are mandatory. You can install redis by checking this link https://redis.io/topics/quickstart
- Cron library user for scheduler. You can generate your own cron scheduler here
startFetch();
Based on the scheduler time the data is scraped and updated to redis. You can find the redis keys here
Datas are scraped from