parent
2d81ed2145
commit
cf59da5d9e
1 changed files with 3 additions and 4 deletions
7
gog.js
7
gog.js
|
|
@ -93,10 +93,9 @@ try {
|
||||||
if (!await banner.count()) {
|
if (!await banner.count()) {
|
||||||
console.log('Currently no free giveaway!');
|
console.log('Currently no free giveaway!');
|
||||||
} else {
|
} else {
|
||||||
const text = await page.locator('.giveaway-banner__title').innerText();
|
const text = await page.locator('.giveaway__content-header').innerText();
|
||||||
const title = text.match(/Claim (.*)/)[1];
|
const title = text.match(/Claim (.*) and don't miss the/)[1];
|
||||||
const slug = await banner.getAttribute('href');
|
const url = await banner.locator('a').first().getAttribute('href');
|
||||||
const url = `https://gog.com${slug}`;
|
|
||||||
console.log(`Current free game: ${title} - ${url}`);
|
console.log(`Current free game: ${title} - ${url}`);
|
||||||
db.data[user][title] ||= { title, time: datetime(), url };
|
db.data[user][title] ||= { title, time: datetime(), url };
|
||||||
if (cfg.dryrun) process.exit(1);
|
if (cfg.dryrun) process.exit(1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue