-
Notifications
You must be signed in to change notification settings - Fork 0
/
puppeteerConfig.js
55 lines (51 loc) · 1.3 KB
/
puppeteerConfig.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// config.js
const config = {
test: {
url: 'https://example.com/test',
navigationTimeout: 30000,
waitForTimer: 500,
numberOfTeamsToLimit: 2,
},
full: {
url: 'https://example.com/full',
navigationTimeout: 60000,
waitForTimer: 500,
numberOfTeamsToLimit: null,
}
};
// Common variables
const commonConfig = {
actions: {
eventPage: 9,
teamPage: 33,
songPage: 31,
},
events: {
urlPrefix: 'https://manbow.nothing.sh/event/event.cgi?',
bofnt: {
eventKey: 142,
shortName: "bofnt",
fullName: '[THE BMS OF FIGHTERS : NT]',
subTitle: "-Twinkle Dream Traveler-",
},
bofet: {
eventKey: 140,
shortName: "bofet",
fullName: '[THE BMS OF FIGHTERS : ET]',
subTitle: "-Summer Dream Traveler-",
},
}
};
// Function to get the event with the latest eventKey
const getLatestEvent = (events) => {
let latestEvent = null;
for (const key in events) {
if (events[key].eventKey && (!latestEvent || events[key].eventKey > latestEvent.eventKey)) {
latestEvent = events[key];
}
}
return latestEvent;
};
const latestEvent = getLatestEvent(commonConfig.events);
const mode = process.env.MODE || 'full'; // Default to 'full' if MODE is not set
export default { ...config[mode], ...commonConfig, latestEvent };