chore: code formatting
This commit is contained in:
@@ -24,15 +24,15 @@ export default async function({login, q, imports, data, account}, {enabled = fal
|
||||
|
||||
//Load page
|
||||
console.debug(`metrics/compute/${login}/plugins > skyline > loading skyline.github.com/${login}/${year}`)
|
||||
await page.goto(`https://skyline.github.com/${login}/${year}`, {timeout:90 * 1000})
|
||||
await page.goto(`https://skyline.github.com/${login}/${year}`, {timeout: 90 * 1000})
|
||||
console.debug(`metrics/compute/${login}/plugins > skyline > waiting for initial render`)
|
||||
const frame = page.mainFrame()
|
||||
await page.waitForFunction('[...document.querySelectorAll("span")].map(span => span.innerText).includes("Share on Twitter")', {timeout:90 * 1000})
|
||||
await page.waitForFunction('[...document.querySelectorAll("span")].map(span => span.innerText).includes("Share on Twitter")', {timeout: 90 * 1000})
|
||||
await frame.evaluate(() => [...document.querySelectorAll("button, footer, a")].map(element => element.remove()))
|
||||
|
||||
//Generate gif
|
||||
console.debug(`metrics/compute/${login}/plugins > skyline > generating frames`)
|
||||
const animation = compatibility ? await imports.record({page, width, height, frames, scale:quality}) : await imports.gif({page, width, height, frames, quality:Math.max(1, quality * 20)})
|
||||
const animation = compatibility ? await imports.record({page, width, height, frames, scale: quality}) : await imports.gif({page, width, height, frames, quality: Math.max(1, quality * 20)})
|
||||
|
||||
//Close puppeteer
|
||||
await browser.close()
|
||||
@@ -42,6 +42,6 @@ export default async function({login, q, imports, data, account}, {enabled = fal
|
||||
}
|
||||
//Handle errors
|
||||
catch (error) {
|
||||
throw {error:{message:"An error occured", instance:error}}
|
||||
throw {error: {message: "An error occured", instance: error}}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user