You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
479 B
JavaScript

4 weeks ago
import 'dotenv/config'
import puppeteer from 'puppeteer'
4 weeks ago
import fetchILMeteo from './scrapers/iLMeteo.js'
4 weeks ago
const NIX_OPS = {
executablePath: process.env.NIX_CHROMIUM_PATH,
}
const opts = process.env.ON_NIX ? NIX_OPS : {}
const run = async () => {
4 weeks ago
const browser = await puppeteer.launch(opts)
const [iLMeteo] = await Promise.all([fetchILMeteo(browser)])
4 weeks ago
await browser.close()
return { iLMeteo }
4 weeks ago
}
console.dir(await run(), { depth: null })
// await run()