-
-
Notifications
You must be signed in to change notification settings - Fork 90
/
Eilaluth.js
34 lines (32 loc) · 3.63 KB
/
Eilaluth.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// covid 19 tracker with simple table in nodejs
const axios = require('axios');
axios.all([
axios.get(`https://apicovid19indonesia-v2.vercel.app/api/indonesia`),
axios.get(`https://apicovid19indonesia-v2.vercel.app/api/indonesia/provinsi`)
])
.then(axios.spread((covidid, covidprov) => {
const stringlength = 69;
console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`);
console.log(` ┃ DATA COVID 19 DI INDONESIA` + " ".repeat(-1 + stringlength - ` ┃ `.length - ` DATA COVID 19 DI INDONESIA`.length) + " ┃");
console.log(` ┃ ┃`);
console.log(` ┃ ┃`);
console.log(` ┃ POSITIF : ${covidid.data.positif} | SEMBUH : ${covidid.data.sembuh} | MENINGGAL : ${covidid.data.meninggal}` + " ".repeat(-1 + stringlength - ` ┃ `.length - ` POSITIF : ${covidid.data.positif} | SEMBUH : ${covidid.data.sembuh} | MENINGGAL : ${covidid.data.meninggal}`.length) + " ┃");
console.log(` ┃ ┃`);
console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`);
console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`);
console.log(` ┃ DATA COVID 19 DI SELURUH PROVINSI DI INDONESIA` + " ".repeat(-1 + stringlength - ` ┃ `.length - ` DATA COVID 19 DI SELURUH PROVINSI DI INDONESIA`.length) + " ┃");
console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`);
console.log(` ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`);
for(i = 0; i <= 33; i++) {
console.log(` ┃ ┃`);
console.log(` ┃ ${covidprov.data[i].provinsi}` + " ".repeat(-1 + stringlength - ` ┃ `.length - ` ${covidprov.data[i].provinsi}`.length) + " ┃");
console.log(` ┃ ┃`);
console.log(` ┃ ┃`);
console.log(` ┃ POSITIF: ${covidprov.data[i].kasus} SEMBUH: ${covidprov.data[i].sembuh} MENINGGAL: ${covidprov.data[i].meninggal}` + " ".repeat(-1 + stringlength - ` ┃ `.length - ` POSITIF: ${covidprov.data[i].kasus} SEMBUH: ${covidprov.data[i].sembuh} MENINGGAL: ${covidprov.data[i].meninggal}`.length) + " ┃");
console.log(` ┃ ┃`);
}
console.log(` ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`);
}))
.catch((err) => {
console.log("Something error")
})