chore: integrate old MemoryPalace files and configure auto-commit
This commit is contained in:
49
code/junk-drawer/P!P/allRoles.md
Normal file
49
code/junk-drawer/P!P/allRoles.md
Normal file
@@ -0,0 +1,49 @@
|
||||
# Play! Pokémon GO Judge Roles
|
||||
|
||||
## Pokémon GO Floor Judge
|
||||
|
||||
**Duties and Responsibilities:**
|
||||
|
||||
- **On-the-Ground Support:** Floor Judges are responsible for handling issues and inquiries from participants during the event. They’re the first point of contact for players who need assistance or have questions.
|
||||
- **Rule Enforcement:** They ensure that the rules of the tournament or event are being followed. This includes monitoring gameplay, addressing rule violations, and making sure that matches are conducted fairly.
|
||||
- **Match Oversight:** Floor Judges may be assigned to oversee specific matches, ensuring that they are played according to the established rules and resolving any disputes that arise.
|
||||
- **Player Assistance:** They provide guidance and support to players, including helping them with registration issues, understanding event procedures, and addressing any concerns they might have.
|
||||
- **Reporting Issues:** They report any significant issues or disputes to the higher-ranking judges (Assistant Head Judge or Head Judge) for resolution.
|
||||
- **Technical Issues:** Help the players with logging in and more importantly when logging out how to remove personal information from the phones.
|
||||
- **Team Checks:** On an as needed bases, check the players team posted on RK9 and compare it to the team shown on the phone they are using. In addition, using gameplay footage to verify is always good to do if you have time.
|
||||
- **Match Reporting:** Using Challonge to update what tables are playing currently as well as the final scores when a player raises their hands.
|
||||
- **Crowd Control:** Making sure other players are giving an appropriate distance from the table to give the active players comfortable and focused on the games at hand. Also assists with deterring cheating.
|
||||
- **Housekeeping:** Making sure the stations where players will be playing is clean, free from debris or clutter. In addition, phones are connected to the chargers and back on the stands. Chairs should be pushed in and ready for the next player.
|
||||
- **Phone Testing:** Logging in to the phones with the organizers' Google login to make sure that assets are downloaded, game functions properly, and battles do not seem to have any issues.
|
||||
- **Game Disputes:** Handle any game disputes the players might have. You are the first line of defense in terms of being able to solve their problem and make a ruling. After making a ruling always explain to them if they would like to appeal to a head judge they may ask for that.
|
||||
- **Penalties:** Handle explaining any penalties the player might incur from being late, not submitting a team, not having the same Pokémon registered in RK9 vs what they are playing with in a manner they can understand and can comply with.
|
||||
|
||||
## Pokémon GO Assistant Head Judge
|
||||
|
||||
**Duties and Responsibilities:**
|
||||
|
||||
- **Support to Head Judge:** Work closely with the Head Judge to help manage the event, including providing support for decision-making and overall event management.
|
||||
- **Rule Interpretation:** Assist in interpreting and applying rules during the event, particularly in more complex situations or when disputes arise.
|
||||
- **Dispute Resolution:** Handle disputes or rule violations that are escalated from Floor Judges. Provide fair and consistent resolutions based on the event rules and guidelines.
|
||||
- **Judge Coordination:** Help coordinate and manage the Floor Judges, ensuring they are performing their duties correctly and effectively.
|
||||
- **Logistical Support:** Assist with the logistical aspects of the event, including scheduling, match management, and ensuring the event progresses smoothly.
|
||||
|
||||
## Pokémon GO Head Judge
|
||||
|
||||
**Duties and Responsibilities:**
|
||||
|
||||
- **Event Management:** Oversee the entire event, ensuring that it is conducted according to the established rules and regulations.
|
||||
- **Final Decision-Making:** Make final decisions on disputes and rule violations that have been escalated from the Assistant Head Judge. Their decisions are authoritative and final.
|
||||
- **Rule Consistency:** Ensure that the rules are applied consistently across all matches and that all participants are treated fairly.
|
||||
- **Team Oversight:** Manage and oversee the judging team, including Floor Judges and Assistant Head Judge. Provide guidance, support, and address any issues within the judging team.
|
||||
- **Communication:** Act as the primary liaison between the event organizers and the judging team, ensuring that any major issues or changes are communicated effectively.
|
||||
|
||||
## Pokémon GO Lead Judge
|
||||
|
||||
**Duties and Responsibilities:**
|
||||
|
||||
- **Event Planning:** Involved in the planning and preparation stages of the event, working with organizers to ensure all aspects of the event are properly coordinated.
|
||||
- **Judge Training:** Responsible for the training and preparation of the judging team, including Floor Judges and Assistant Head Judges, to ensure they are well-versed in the rules and their roles.
|
||||
- **Strategic Oversight:** Provide strategic oversight for the event, making high-level decisions to ensure the event runs smoothly and addressing any significant issues that arise.
|
||||
- **Complex Issue Resolution:** Handle complex or high-profile disputes and problems that may arise during the event, ensuring fair and balanced resolutions.
|
||||
- **Reporting and Evaluation:** Provide post-event reports and evaluations to organizers and stakeholders, summarizing the event's success, challenges, and areas for improvement.
|
||||
9
code/junk-drawer/P!P/assistant-head-judge.txt
Normal file
9
code/junk-drawer/P!P/assistant-head-judge.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
## Pokémon GO Assistant Head Judge
|
||||
|
||||
**Duties and Responsibilities:**
|
||||
|
||||
- **Support to Head Judge:** Work closely with the Head Judge to help manage the event, including providing support for decision-making and overall event management.
|
||||
- **Rule Interpretation:** Assist in interpreting and applying rules during the event, particularly in more complex situations or when disputes arise.
|
||||
- **Dispute Resolution:** Handle disputes or rule violations that are escalated from Floor Judges. Provide fair and consistent resolutions based on the event rules and guidelines.
|
||||
- **Judge Coordination:** Help coordinate and manage the Floor Judges, ensuring they are performing their duties correctly and effectively.
|
||||
- **Logistical Support:** Assist with the logistical aspects of the event, including scheduling, match management, and ensuring the event progresses smoothly.
|
||||
17
code/junk-drawer/P!P/floor-judge.txt
Normal file
17
code/junk-drawer/P!P/floor-judge.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
## Pokémon GO Floor Judge
|
||||
|
||||
**Duties and Responsibilities:**
|
||||
|
||||
- **On-the-Ground Support:** Floor Judges are responsible for handling issues and inquiries from participants during the event. They’re the first point of contact for players who need assistance or have questions.
|
||||
- **Rule Enforcement:** They ensure that the rules of the tournament or event are being followed. This includes monitoring gameplay, addressing rule violations, and making sure that matches are conducted fairly.
|
||||
- **Match Oversight:** Floor Judges may be assigned to oversee specific matches, ensuring that they are played according to the established rules and resolving any disputes that arise.
|
||||
- **Player Assistance:** They provide guidance and support to players, including helping them with registration issues, understanding event procedures, and addressing any concerns they might have.
|
||||
- **Reporting Issues:** They report any significant issues or disputes to the higher-ranking judges (Assistant Head Judge or Head Judge) for resolution.
|
||||
- **Technical Issues:** Help the players with logging in and more importantly when logging out how to remove personal information from the phones.
|
||||
- **Team Checks:** On an as needed bases, check the players team posted on RK9 and compare it to the team shown on the phone they are using. In addition, using gameplay footage to verify is always good to do if you have time.
|
||||
- **Match Reporting:** Using Challonge to update what tables are playing currently as well as the final scores when a player raises their hands.
|
||||
- **Crowd Control:** Making sure other players are giving an appropriate distance from the table to give the active players comfortable and focused on the games at hand. Also assists with deterring cheating.
|
||||
- **Housekeeping:** Making sure the stations where players will be playing is clean, free from debris or clutter. In addition, phones are connected to the chargers and back on the stands. Chairs should be pushed in and ready for the next player.
|
||||
- **Phone Testing:** Logging in to the phones with the organizers' Google login to make sure that assets are downloaded, game functions properly, and battles do not seem to have any issues.
|
||||
- **Game Disputes:** Handle any game disputes the players might have. You are the first line of defense in terms of being able to solve their problem and make a ruling. After making a ruling always explain to them if they would like to appeal to a head judge they may ask for that.
|
||||
- **Penalties:** Handle explaining any penalties the player might incur from being late, not submitting a team, not having the same Pokémon registered in RK9 vs what they are playing with in a manner they can understand and can comply with.
|
||||
9
code/junk-drawer/P!P/head-judge.txt
Normal file
9
code/junk-drawer/P!P/head-judge.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
## Pokémon GO Head Judge
|
||||
|
||||
**Duties and Responsibilities:**
|
||||
|
||||
- **Event Management:** Oversee the entire event, ensuring that it is conducted according to the established rules and regulations.
|
||||
- **Final Decision-Making:** Make final decisions on disputes and rule violations that have been escalated from the Assistant Head Judge. Their decisions are authoritative and final.
|
||||
- **Rule Consistency:** Ensure that the rules are applied consistently across all matches and that all participants are treated fairly.
|
||||
- **Team Oversight:** Manage and oversee the judging team, including Floor Judges and Assistant Head Judge. Provide guidance, support, and address any issues within the judging team.
|
||||
- **Communication:** Act as the primary liaison between the event organizers and the judging team, ensuring that any major issues or changes are communicated effectively.
|
||||
9
code/junk-drawer/P!P/lead.txt
Normal file
9
code/junk-drawer/P!P/lead.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
## Pokémon GO Lead Judge
|
||||
|
||||
**Duties and Responsibilities:**
|
||||
|
||||
- **Event Planning:** Involved in the planning and preparation stages of the event, working with organizers to ensure all aspects of the event are properly coordinated.
|
||||
- **Judge Training:** Responsible for the training and preparation of the judging team, including Floor Judges and Assistant Head Judges, to ensure they are well-versed in the rules and their roles.
|
||||
- **Strategic Oversight:** Provide strategic oversight for the event, making high-level decisions to ensure the event runs smoothly and addressing any significant issues that arise.
|
||||
- **Complex Issue Resolution:** Handle complex or high-profile disputes and problems that may arise during the event, ensuring fair and balanced resolutions.
|
||||
- **Reporting and Evaluation:** Provide post-event reports and evaluations to organizers and stakeholders, summarizing the event's success, challenges, and areas for improvement.
|
||||
46
code/junk-drawer/README.md
Normal file
46
code/junk-drawer/README.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Junk Drawer
|
||||
|
||||
Miscellaneous code, scripts, and work-in-progress items.
|
||||
|
||||
## 📝 Purpose
|
||||
|
||||
This folder is for:
|
||||
- Scripts that don't have a clear home yet
|
||||
- Work-in-progress code being developed
|
||||
- One-off utilities and helpers
|
||||
- Experimental code that may be moved later
|
||||
- Quick prototypes and POCs
|
||||
|
||||
## 📁 Current Contents
|
||||
|
||||
### Scripts
|
||||
- **handleCCOMention.js** - Custom mention handler utility
|
||||
- **scrape.js** - Web scraping helper functions
|
||||
- **tts-copypasta-hall-of-fame.json** - Text-to-speech copypasta collection
|
||||
|
||||
### Pokemon Still Needed
|
||||
- **pokemon still needed.txt** - Tracking list
|
||||
|
||||
### P!P (Pokémon Play! Program)
|
||||
Role documentation and references:
|
||||
- **allRoles.md** - Complete role overview
|
||||
- **assistant-head-judge.txt** - Assistant Head Judge role
|
||||
- **floor-judge.txt** - Floor Judge role
|
||||
- **head-judge.txt** - Head Judge role
|
||||
- **lead.txt** - Lead role
|
||||
|
||||
## 🔄 Maintenance
|
||||
|
||||
As items mature or find a permanent home:
|
||||
- Move utilities to `/code/utils/`
|
||||
- Move bookmarklets to `/code/bookmarklets/`
|
||||
- Move documentation to `/docs/projects/` or `/docs/reference-material/`
|
||||
- Move experiments to `/code/scratchpad/`
|
||||
- Delete obsolete items
|
||||
|
||||
## 💡 Tips
|
||||
|
||||
- Add TODO comments for items that need work
|
||||
- Use descriptive filenames
|
||||
- Clean up regularly - don't let this become a permanent dumping ground
|
||||
- Consider creating a proper folder structure once you have 3+ related items
|
||||
30
code/junk-drawer/handleCCOMention.js
Normal file
30
code/junk-drawer/handleCCOMention.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Load the JSON file
|
||||
const copypastaFilePath = path.join(
|
||||
__dirname,
|
||||
'./tts-copypasta-hall-of-fame.json'
|
||||
);
|
||||
|
||||
let copypastaData = null;
|
||||
if (fs.existsSync(copypastaFilePath)) {
|
||||
copypastaData = JSON.parse(fs.readFileSync(copypastaFilePath, 'utf8'));
|
||||
}
|
||||
|
||||
module.exports = async message => {
|
||||
if (message.content.toLowerCase().includes('cco')) {
|
||||
// Select a random object from the JSON data
|
||||
if (!copypastaData) {
|
||||
await message.reply('I miss Charl');
|
||||
} else {
|
||||
const randomIndex = Math.floor(
|
||||
Math.random() * copypastaData?.messages.length
|
||||
);
|
||||
const randomCopypasta = copypastaData.messages[randomIndex];
|
||||
|
||||
// Reply with the content key value
|
||||
await message.reply(randomCopypasta.content);
|
||||
}
|
||||
}
|
||||
};
|
||||
269
code/junk-drawer/pokemon still needed.txt
Normal file
269
code/junk-drawer/pokemon still needed.txt
Normal file
@@ -0,0 +1,269 @@
|
||||
Alolan Diglett
|
||||
Alolan Geodude
|
||||
Alolan Graveler
|
||||
Alolan Golem
|
||||
Galarian Slowpoke
|
||||
Galarian Slowbro
|
||||
Hisuian Electrode
|
||||
Goldeen
|
||||
Female Seaking
|
||||
Galarian Moltres
|
||||
Mew
|
||||
Female Ledyba
|
||||
Female Ledian
|
||||
Sudowoodo
|
||||
Wooper
|
||||
Quagsire
|
||||
Galarian Slowking
|
||||
b Unown
|
||||
c Unown
|
||||
f Unown
|
||||
j Unown
|
||||
k Unown
|
||||
p Unown
|
||||
q Unown
|
||||
r Unown
|
||||
v Unown
|
||||
w Unown
|
||||
x Unown
|
||||
z Unown
|
||||
Female Wobbuffet
|
||||
Female Gligar
|
||||
Female Steelix
|
||||
Ursaring
|
||||
Corsola
|
||||
Galarian Corsola
|
||||
Female Houndoom
|
||||
Phanpy
|
||||
Donphan
|
||||
Female Donphan
|
||||
Stantler
|
||||
Female Torchic
|
||||
Female Combusken
|
||||
Female Blaziken
|
||||
Female Beautifly
|
||||
Ludicolo
|
||||
Female Nuzleaf
|
||||
Female Shiftry
|
||||
Meditite
|
||||
Female Roselia
|
||||
Female Gulpin
|
||||
Female Swalot
|
||||
Numel
|
||||
Female Camerupt
|
||||
Female Cacturne
|
||||
Jirachi
|
||||
Starly
|
||||
Female Staravia
|
||||
Staraptor
|
||||
Female Kricketune
|
||||
Shinx
|
||||
Female Luxio
|
||||
Female Luxray
|
||||
Roserade
|
||||
Female Pachirisu
|
||||
Buizel
|
||||
Female Floatzel
|
||||
Shellos
|
||||
Gastrodon
|
||||
Ambipom
|
||||
Gible
|
||||
Hippowdon
|
||||
Croagunk
|
||||
Female Toxicroak
|
||||
Female Finneon
|
||||
Female Lumineon
|
||||
Female Snover
|
||||
Abomasnow
|
||||
Magnezone
|
||||
Rhyperior
|
||||
Female Tangrowth
|
||||
Female Mamoswine
|
||||
Dusknoir
|
||||
Rotom
|
||||
Heat Rotom
|
||||
Wash Rotom
|
||||
Frost Rotom
|
||||
Fan Rotom
|
||||
Mow Rotom
|
||||
Phione
|
||||
Manaphy
|
||||
Shaymin
|
||||
Sky Shaymin
|
||||
Arceus
|
||||
Victini
|
||||
Excadrill
|
||||
Hisuian Lilligant
|
||||
Basculin
|
||||
Blue Stripe Basculin
|
||||
Maractus
|
||||
Scrafty
|
||||
Sigilyph
|
||||
Hisuian Zorua
|
||||
Hisuian Zoroark
|
||||
Gothita
|
||||
Duosion
|
||||
Reuniclus
|
||||
Vanillish
|
||||
Vanilluxe
|
||||
Deerling
|
||||
Fall Deerling
|
||||
Winter Deerling
|
||||
Sawsbuck
|
||||
Fall Sawsbuck
|
||||
Winter Sawsbuck
|
||||
Jellicent
|
||||
Bouffalant
|
||||
Therian Tornadus
|
||||
Keldeo
|
||||
Resolute Keldeo
|
||||
Meloetta
|
||||
Poké Ball Vivillon
|
||||
Pyroar
|
||||
Flabébé
|
||||
Orange Flower Flabébé
|
||||
Blue Flower Flabébé
|
||||
White Flower Flabébé
|
||||
Floette
|
||||
Yellow Flower Floette
|
||||
Orange Flower Floette
|
||||
Blue Flower Floette
|
||||
White Flower Floette
|
||||
Florges
|
||||
Yellow Flower Florges
|
||||
Orange Flower Florges
|
||||
Blue Flower Florges
|
||||
White Flower Florges
|
||||
Star Furfrou
|
||||
Diamond Furfrou
|
||||
Debutante Furfrou
|
||||
Matron Furfrou
|
||||
Dandy Furfrou
|
||||
La Reine Furfrou
|
||||
Pharaoh Furfrou
|
||||
Honedge
|
||||
Doublade
|
||||
Aegislash
|
||||
Sylveon
|
||||
Carbink
|
||||
Hisuian Sliggoo
|
||||
Hisuian Goodra
|
||||
Pumpkaboo
|
||||
Small Pumpkaboo
|
||||
Large Pumpkaboo
|
||||
Super Pumpkaboo
|
||||
Gourgeist
|
||||
Small Gourgeist
|
||||
Large Gourgeist
|
||||
Super Gourgeist
|
||||
0.1 Zygarde
|
||||
Diancie
|
||||
Hoopa
|
||||
Hoopa
|
||||
Volcanion
|
||||
Pikipek
|
||||
Trumbeak
|
||||
Toucannon
|
||||
Wishiwashi
|
||||
Comfey
|
||||
Pyukumuku
|
||||
Type: Null
|
||||
Minior
|
||||
Turtonator
|
||||
Bruxish
|
||||
Drampa
|
||||
Dhelmise
|
||||
Cosmog
|
||||
Cosmoem
|
||||
Solgaleo
|
||||
Lunala
|
||||
Magearna
|
||||
Marshadow
|
||||
Poipole
|
||||
Naganadel
|
||||
Stakataka
|
||||
Blacephalon
|
||||
Cinderace
|
||||
Drizzile
|
||||
Blipbug
|
||||
Dottler
|
||||
Orbeetle
|
||||
Nickit
|
||||
Thievul
|
||||
Gossifleur
|
||||
Eldegoss
|
||||
Yamper
|
||||
Boltund
|
||||
Silicobra
|
||||
Sandaconda
|
||||
Arrokuda
|
||||
Barraskewda
|
||||
Sizzlipede
|
||||
Centiskorch
|
||||
Clobbopus
|
||||
Grapploct
|
||||
Hatenna
|
||||
Hattrem
|
||||
Hatterene
|
||||
Morgrem
|
||||
Cursola
|
||||
Mr. Rime
|
||||
Star Alcremie
|
||||
Ribbon Alcremie
|
||||
Pincurchin
|
||||
Stonjourner
|
||||
Duraludon
|
||||
Kubfu
|
||||
Urshifu
|
||||
Rapid Strike Urshifu
|
||||
Zarude
|
||||
Dada Zarude
|
||||
Regieleki
|
||||
Regidrago
|
||||
Glastrier
|
||||
Spectrier
|
||||
Calyrex
|
||||
Bloodmoon Ursaluna
|
||||
Enamorus
|
||||
Therian Enamorus
|
||||
Floragato
|
||||
Fuecoco
|
||||
Crocalor
|
||||
Quaxly
|
||||
Quaxwell
|
||||
Female Oinkologne
|
||||
Nymble
|
||||
Lokix
|
||||
Maushold
|
||||
Fidough
|
||||
Dachsbun
|
||||
Bellibolt
|
||||
Wattrel
|
||||
Tinkatink
|
||||
Tinkatuff
|
||||
Wiglett
|
||||
Veluza
|
||||
3 Segment Dudunsparce
|
||||
Iron Hands
|
||||
Roaming Form Gimmighoul
|
||||
Wo-Chien
|
||||
Chien-Pao
|
||||
Ting-Lu
|
||||
Chi-Yu
|
||||
Koraidon
|
||||
Miraidon
|
||||
Walking wake
|
||||
Iron leaves
|
||||
Poltchageist
|
||||
Sinistcha
|
||||
Okidogi
|
||||
Munkidori
|
||||
Fezandipiti
|
||||
Ogerpon
|
||||
Archaludon
|
||||
Gouging Fire
|
||||
Raging Bolt
|
||||
Iron Boulder
|
||||
Iron Crown
|
||||
Terapagos
|
||||
Pecharunt
|
||||
@@ -28,33 +28,33 @@
|
||||
*
|
||||
* Currently not working due to recaptch on P!P site
|
||||
*/
|
||||
const puppeteer = require("puppeteer");
|
||||
const cheerio = require("cheerio");
|
||||
const puppeteer = require('puppeteer');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
async function scrapeWebsite(url) {
|
||||
// Launch Puppeteer
|
||||
const browser = await puppeteer.launch({
|
||||
headless: false, // Run in headless mode
|
||||
args: [
|
||||
"--no-sandbox",
|
||||
"--disable-setuid-sandbox",
|
||||
"--disable-dev-shm-usage",
|
||||
"--disable-accelerated-2d-canvas",
|
||||
"--disable-gpu",
|
||||
"--window-size=1920x1080",
|
||||
],
|
||||
'--no-sandbox',
|
||||
'--disable-setuid-sandbox',
|
||||
'--disable-dev-shm-usage',
|
||||
'--disable-accelerated-2d-canvas',
|
||||
'--disable-gpu',
|
||||
'--window-size=1920x1080'
|
||||
]
|
||||
});
|
||||
const page = await browser.newPage();
|
||||
// Set user agent to mimic a real browser
|
||||
await page.setUserAgent(
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
|
||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
|
||||
);
|
||||
|
||||
// Set viewport to mimic a real browser
|
||||
await page.setViewport({ width: 1920, height: 1080 });
|
||||
|
||||
// Navigate to the URL
|
||||
await page.goto(url, { waitUntil: "networkidle2" });
|
||||
await page.goto(url, { waitUntil: 'networkidle2' });
|
||||
|
||||
// Simulate human-like interactions
|
||||
await page.waitForTimeout(2000); // Wait for 2 seconds
|
||||
@@ -70,41 +70,41 @@ async function scrapeWebsite(url) {
|
||||
const $ = cheerio.load(content);
|
||||
|
||||
// Find all table elements
|
||||
const tables = $("table");
|
||||
const tables = $('table');
|
||||
const data = [];
|
||||
|
||||
// Loop through each table
|
||||
tables.each((index, table) => {
|
||||
const headers = [];
|
||||
const rows = $(table).find("tr");
|
||||
const rows = $(table).find('tr');
|
||||
|
||||
// Check if the first row contains the headers Date, Venue, and Location
|
||||
const firstRow = rows.first();
|
||||
firstRow.find("tr").each((i, th) => {
|
||||
firstRow.find('tr').each((i, th) => {
|
||||
headers.push($(th).text().trim().toLowerCase());
|
||||
});
|
||||
|
||||
if (
|
||||
headers.includes("date") &&
|
||||
headers.includes("venue") &&
|
||||
headers.includes("location")
|
||||
headers.includes('date') &&
|
||||
headers.includes('venue') &&
|
||||
headers.includes('location')
|
||||
) {
|
||||
// Loop through the remaining rows and extract data
|
||||
rows.slice(1).each((i, row) => {
|
||||
const cells = $(row).find("td");
|
||||
const cells = $(row).find('td');
|
||||
const rowData = {};
|
||||
|
||||
cells.each((j, cell) => {
|
||||
const header = headers[j];
|
||||
const cellText = $(cell).text().trim();
|
||||
|
||||
if (header === "date") {
|
||||
const dates = cellText.split(" - ");
|
||||
if (header === 'date') {
|
||||
const dates = cellText.split(' - ');
|
||||
rowData.startDate = dates[0];
|
||||
rowData.endDate = dates[1] || dates[0];
|
||||
} else if (header === "venue") {
|
||||
} else if (header === 'venue') {
|
||||
rowData.venue = cellText;
|
||||
} else if (header === "location") {
|
||||
} else if (header === 'location') {
|
||||
rowData.location = cellText;
|
||||
}
|
||||
});
|
||||
@@ -119,7 +119,7 @@ async function scrapeWebsite(url) {
|
||||
|
||||
// Example usage
|
||||
const url =
|
||||
"https://www.pokemon.com/us/play-pokemon/pokemon-events/championship-series/2025/regional-special-championships";
|
||||
'https://www.pokemon.com/us/play-pokemon/pokemon-events/championship-series/2025/regional-special-championships';
|
||||
scrapeWebsite(url)
|
||||
.then((data) => console.log(data))
|
||||
.catch((error) => console.error(error));
|
||||
.then(data => console.log(data))
|
||||
.catch(error => console.error(error));
|
||||
|
||||
Reference in New Issue
Block a user