mirror of
https://github.com/ssyyhhrr/stewardle.git
synced 2025-11-13 04:23:46 -05:00
DOTD Fix
This commit is contained in:
2
app.js
2
app.js
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user