This commit is contained in:
ssyyhhrr
2022-06-23 21:26:43 +01:00
parent 3372bb2d71
commit a00e112b2c

2
app.js
View File

@@ -86,7 +86,6 @@ async function main() {
} }
async function updateDrivers() { async function updateDrivers() {
let drivers = {}
for (let i = 2000; i <= year; i++) { for (let i = 2000; i <= year; i++) {
console.log(`Scraping F1 ${i} Season...`) console.log(`Scraping F1 ${i} Season...`)
await axios.get(`http://ergast.com/api/f1/${i}/driverStandings.json?limit=1000`).then(res => { await axios.get(`http://ergast.com/api/f1/${i}/driverStandings.json?limit=1000`).then(res => {
@@ -127,6 +126,7 @@ function dotd() {
driver = getRandomProperty(drivers) driver = getRandomProperty(drivers)
console.log(`Driver of the Day is ${driver}!`) console.log(`Driver of the Day is ${driver}!`)
console.log(drivers[driver]) console.log(drivers[driver])
drivers = {}
} }
function getRandomProperty(obj) { function getRandomProperty(obj) {