Skip to content

Commit

Permalink
fix: 🗃️ update cardDefIds data
Browse files Browse the repository at this point in the history
  • Loading branch information
lkotlarenko committed Jun 8, 2024
1 parent e8185c4 commit 4d2fd5e
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 2 deletions.
5 changes: 5 additions & 0 deletions cardDefIds creator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,24 @@ const DATA_DOMAIN = process.env.DATA_URL;
const scrapeData = async () => {
puppeteer.use(StealthPlugin());
// launch the puppeteer
console.log('Launching the puppeteer...');
const browser = await puppeteer.launch({
headless: 'new',
executablePath: executablePath(),
});
const page = await browser.newPage();
console.log('Requesting html from DATA_URL in .env file...');
// Request html from DATA_URL in .env file
await page.goto(`${DATA_DOMAIN}cards/`);
console.log('Waiting for the cards to load...');
// Wait for the cards to load (modify the selector as needed)
await page.waitForSelector('a.simple-card');
console.log('Get the HTML content after the cards are loaded...');
// Get the HTML content after the cards are loaded
const html = await page.content();
// Close the browser
await browser.close();
console.log('Generating the content for the .js file...');
// Parse HTML using Cheerio
const $ = cheerio.load(html);

Expand Down
70 changes: 68 additions & 2 deletions src/data/cardDefIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,67 @@ import { CardDef } from '../Interfaces/CardDef';
const cardDefIds: CardDef[] = [
{ name: 'abomination', carddefid: 'Abomination' },
{ name: 'absorbing man', carddefid: 'AbsorbingMan' },
{ name: 'acid arrow', carddefid: 'AcidArrow' },
{ name: 'adam warlock', carddefid: 'AdamWarlock' },
{ name: 'aero', carddefid: 'Aero' },
{ name: 'agatha harkness', carddefid: 'AgathaHarkness' },
{ name: 'agent 13', carddefid: 'Agent13' },
{ name: 'agent coulson', carddefid: 'AgentCoulson' },
{ name: 'ajax', carddefid: 'Ajax' },
{ name: 'alioth', carddefid: 'Alioth' },
{ name: 'america chavez', carddefid: 'AmericaChavez' },
{ name: 'angel', carddefid: 'Angel' },
{ name: 'angela', carddefid: 'Angela' },
{ name: 'annihilus', carddefid: '' },
{ name: 'annihilus', carddefid: 'Annihilus' },
{ name: 'ant man', carddefid: 'AntMan' },
{ name: 'apocalypse', carddefid: 'Apocalypse' },
{ name: 'arishem', carddefid: 'Arishem' },
{ name: 'armor', carddefid: 'Armor' },
{ name: 'arnim zola', carddefid: 'ArnimZola' },
{ name: 'attuma', carddefid: 'Attuma' },
{ name: 'baron mordo', carddefid: 'BaronMordo' },
{ name: 'baron zemo', carddefid: 'BaronZemo' },
{ name: 'basic arrow', carddefid: 'BasicArrow' },
{ name: 'bast', carddefid: 'Bast' },
{ name: 'beast', carddefid: 'Beast' },
{ name: 'beta ray bill', carddefid: 'BetaRayBill' },
{ name: 'bishop', carddefid: 'Bishop' },
{ name: 'black bolt', carddefid: 'BlackBolt' },
{ name: 'black cat', carddefid: 'BlackCat' },
{ name: 'black knight', carddefid: 'BlackKnight' },
{ name: 'black panther', carddefid: 'BlackPanther' },
{ name: 'black swan', carddefid: 'BlackSwan' },
{ name: 'black widow', carddefid: 'BlackWidow' },
{ name: 'blade', carddefid: 'Blade' },
{ name: 'blink', carddefid: 'Blink' },
{ name: 'blob', carddefid: 'Blob' },
{ name: 'blue marvel', carddefid: 'BlueMarvel' },
{ name: 'bob from hydra', carddefid: 'HydraBob' },
{ name: 'brood', carddefid: 'Brood' },
{ name: 'broodling', carddefid: 'Broodling' },
{ name: 'bucky barnes', carddefid: 'BuckyBarnes' },
{ name: 'bullseye', carddefid: 'Bullseye' },
{ name: 'cable', carddefid: 'Cable' },
{ name: 'caiera', carddefid: 'Caiera' },
{ name: 'cannonball', carddefid: 'Cannonball' },
{ name: 'captain america', carddefid: 'CaptainAmerica' },
{ name: 'captain marvel', carddefid: 'CaptainMarvel' },
{ name: 'carnage', carddefid: 'Carnage' },
{ name: 'cassandra nova', carddefid: 'CassandraNova' },
{ name: 'cerebro', carddefid: 'Cerebro' },
{ name: 'chimichanga', carddefid: 'Chimichanga' },
{ name: 'cloak', carddefid: 'Cloak' },
{ name: 'colleen wing', carddefid: 'ColleenWing' },
{ name: 'colossus', carddefid: 'Colossus' },
{ name: 'copycat', carddefid: 'Copycat' },
{ name: 'corvus glaive', carddefid: 'CorvusGlaive' },
{ name: 'cosmo', carddefid: 'Cosmo' },
{ name: 'crossbones', carddefid: 'Crossbones' },
{ name: 'crystal', carddefid: 'Crystal' },
{ name: 'cull obsidian', carddefid: 'CullObsidian' },
{ name: 'cyclops', carddefid: 'Cyclops' },
{ name: 'dagger', carddefid: 'Dagger' },
{ name: 'daken', carddefid: 'Daken' },
{ name: 'daredevil', carddefid: 'Daredevil' },
{ name: 'darkhawk', carddefid: 'Darkhawk' },
{ name: 'dazzler', carddefid: 'Dazzler' },
Expand All @@ -57,6 +74,7 @@ const cardDefIds: CardDef[] = [
{ name: 'demon', carddefid: 'Demon' },
{ name: 'destroyer', carddefid: 'Destroyer' },
{ name: 'devil dinosaur', carddefid: 'DevilDinosaur' },
{ name: 'djinn', carddefid: 'Djinn' },
{ name: 'doctor doom', carddefid: 'DrDoom' },
{ name: 'doctor octopus', carddefid: 'DoctorOctopus' },
{ name: 'doctor strange', carddefid: 'DoctorStrange' },
Expand All @@ -79,6 +97,7 @@ const cardDefIds: CardDef[] = [
{ name: 'evolved the thing', carddefid: 'EvolvedTheThing' },
{ name: 'evolved wasp', carddefid: 'EvolvedWasp' },
{ name: 'falcon', carddefid: 'Falcon' },
{ name: 'firestar', carddefid: 'Firestar' },
{ name: 'flatman', carddefid: 'Flatman' },
{ name: 'forge', carddefid: 'Forge' },
{ name: 'galactus', carddefid: 'Galactus' },
Expand All @@ -88,25 +107,32 @@ const cardDefIds: CardDef[] = [
{ name: 'ghost rider', carddefid: 'GhostRider' },
{ name: 'ghost-spider', carddefid: 'GhostSpider' },
{ name: 'giganto', carddefid: 'Giganto' },
{ name: 'gladiator', carddefid: '' },
{ name: 'gilgamesh', carddefid: 'Gilgamesh' },
{ name: 'gladiator', carddefid: 'Gladiator' },
{ name: 'goblin queen', carddefid: 'GoblinQueen' },
{ name: 'goose', carddefid: 'Goose' },
{ name: 'gorr', carddefid: '' },
{ name: 'grand master', carddefid: 'GrandMaster' },
{ name: 'grapple arrow', carddefid: 'GrappleArrow' },
{ name: 'green goblin', carddefid: 'GreenGoblin' },
{ name: 'groot', carddefid: 'Groot' },
{ name: 'gwenpool', carddefid: 'Gwenpool' },
{ name: 'havok', carddefid: 'Havok' },
{ name: 'hawkeye', carddefid: 'Hawkeye' },
{ name: 'hazmat', carddefid: 'Hazmat' },
{ name: 'heimdall', carddefid: 'Heimdall' },
{ name: 'hela', carddefid: 'Hela' },
{ name: 'helicarrier', carddefid: 'Helicarrier' },
{ name: 'hellcow', carddefid: 'Hellcow' },
{ name: 'hercules', carddefid: 'Hercules' },
{ name: 'high evolutionary', carddefid: 'HighEvolutionary' },
{ name: 'hit monkey', carddefid: 'HitMonkey' },
{ name: 'hobgoblin', carddefid: 'Hobgoblin' },
{ name: 'hope summers', carddefid: 'HopeSummers' },
{ name: 'howard the duck', carddefid: 'HowardTheDuck' },
{ name: 'hulk', carddefid: 'Hulk' },
{ name: 'hulkbuster', carddefid: 'Hulkbuster' },
{ name: 'hulkling', carddefid: 'Hulkling' },
{ name: 'human torch', carddefid: 'HumanTorch' },
{ name: 'iceman', carddefid: 'Iceman' },
{ name: 'illusion!', carddefid: 'MysterioIllusion' },
Expand All @@ -124,6 +150,7 @@ const cardDefIds: CardDef[] = [
{ name: 'juggernaut', carddefid: 'Juggernaut' },
{ name: 'ka-zar', carddefid: 'KaZar' },
{ name: 'kang', carddefid: 'Kang' },
{ name: 'kate bishop', carddefid: 'KateBishop' },
{ name: 'killmonger', carddefid: 'Killmonger' },
{ name: 'king eitri', carddefid: 'KingEitri' },
{ name: 'kingpin', carddefid: 'Kingpin' },
Expand All @@ -139,17 +166,22 @@ const cardDefIds: CardDef[] = [
{ name: 'legion', carddefid: 'Legion' },
{ name: 'lizard', carddefid: 'Lizard' },
{ name: 'lockjaw', carddefid: 'Lockjaw' },
{ name: 'loki', carddefid: 'Loki' },
{ name: 'luke cage', carddefid: 'LukeCage' },
{ name: "m'baku", carddefid: 'MBaku' },
{ name: 'magik', carddefid: 'Magik' },
{ name: 'magneto', carddefid: 'Magneto' },
{ name: 'makkari', carddefid: 'Makkari' },
{ name: 'man-thing', carddefid: 'ManThing' },
{ name: 'mantis', carddefid: 'Mantis' },
{ name: 'maria hill', carddefid: 'MariaHill' },
{ name: 'martyr', carddefid: 'Martyr' },
{ name: 'marvel boy', carddefid: 'MarvelBoy' },
{ name: 'master mold', carddefid: 'MasterMold' },
{ name: 'maximus', carddefid: 'Maximus' },
{ name: 'medusa', carddefid: 'Medusa' },
{ name: 'mephisto', carddefid: 'Mephisto' },
{ name: 'miek', carddefid: 'Miek' },
{ name: 'miles morales', carddefid: 'MilesMorales' },
{ name: 'mind stone', carddefid: 'MindStone' },
{ name: 'mirage', carddefid: 'Mirage' },
Expand All @@ -158,6 +190,8 @@ const cardDefIds: CardDef[] = [
{ name: 'mister sinister', carddefid: 'MrSinister' },
{ name: 'misty knight', carddefid: 'MistyKnight' },
{ name: 'mjölnir', carddefid: 'Mjolnir' },
{ name: 'mobius m. mobius', carddefid: 'MobiusMMobius' },
{ name: 'mockingbird', carddefid: 'Mockingbird' },
{ name: 'modok', carddefid: 'Modok' },
{ name: 'mojo', carddefid: 'Mojo' },
{ name: 'monster', carddefid: 'Monster' },
Expand All @@ -172,33 +206,49 @@ const cardDefIds: CardDef[] = [
{ name: 'mystique', carddefid: 'Mystique' },
{ name: 'nakia', carddefid: 'Nakia' },
{ name: 'namor', carddefid: 'Namor' },
{ name: 'namora', carddefid: 'Namora' },
{ name: 'nebula', carddefid: 'Nebula' },
{ name: 'negasonic teenage warhead', carddefid: 'NegasonicTeenageWarhead' },
{ name: 'nick fury', carddefid: 'NickFury' },
{ name: 'nico minoru', carddefid: 'NicoMinoru' },
{ name: 'nico minoru spell 01', carddefid: 'Spell01NicoMinoru' },
{ name: 'nico minoru spell 02', carddefid: 'Spell02NicoMinoru' },
{ name: 'nico minoru spell 03', carddefid: 'Spell03NicoMinoru' },
{ name: 'nico minoru spell 04', carddefid: 'Spell04NicoMinoru' },
{ name: 'nico minoru spell 05', carddefid: 'Spell05NicoMinoru' },
{ name: 'nico minoru spell 06', carddefid: 'Spell06NicoMinoru' },
{ name: 'nico minoru spell 07', carddefid: 'Spell07NicoMinoru' },
{ name: 'night nurse', carddefid: 'NightNurse' },
{ name: 'nightcrawler', carddefid: 'Nightcrawler' },
{ name: 'nimrod', carddefid: 'Nimrod' },
{ name: 'ninja', carddefid: 'Ninja' },
{ name: 'nocturne', carddefid: 'Nocturne' },
{ name: 'nova', carddefid: 'Nova' },
{ name: 'odin', carddefid: 'Odin' },
{ name: 'okoye', carddefid: 'Okoye' },
{ name: 'omega red', carddefid: 'OmegaRed' },
{ name: 'onslaught', carddefid: 'Onslaught' },
{ name: 'orka', carddefid: 'Orka' },
{ name: 'patriot', carddefid: 'Patriot' },
{ name: 'phastos', carddefid: 'Phastos' },
{ name: 'pig', carddefid: 'Pig' },
{ name: 'pixie', carddefid: 'Pixie' },
{ name: 'polaris', carddefid: 'Polaris' },
{ name: 'power stone', carddefid: 'PowerStone' },
{ name: 'professor x', carddefid: 'ProfessorX' },
{ name: 'proxima midnight', carddefid: 'ProximaMidnight' },
{ name: 'psylocke', carddefid: 'Psylocke' },
{ name: 'punisher', carddefid: 'Punisher' },
{ name: 'pymparticle arrow', carddefid: 'PymParticleArrow' },
{ name: 'quake', carddefid: 'Quake' },
{ name: 'quicksilver', carddefid: 'Quicksilver' },
{ name: 'quinjet', carddefid: 'Quinjet' },
{ name: 'random', carddefid: 'Random' },
{ name: 'raptor', carddefid: 'Raptor' },
{ name: 'ravonna renslayer', carddefid: 'RavonnaRenslayer' },
{ name: 'reality stone', carddefid: 'RealityStone' },
{ name: 'red guardian', carddefid: 'RedGuardian' },
{ name: 'red hulk', carddefid: 'RedHulk' },
{ name: 'red skull', carddefid: 'RedSkull' },
{ name: 'rescue', carddefid: 'Rescue' },
{ name: 'rhino', carddefid: 'Rhino' },
Expand All @@ -208,13 +258,18 @@ const cardDefIds: CardDef[] = [
{ name: 'rogue', carddefid: 'Rogue' },
{ name: 'ronan the accuser', carddefid: 'Ronan' },
{ name: 'sabretooth', carddefid: 'Sabretooth' },
{ name: 'sage', carddefid: 'Sage' },
{ name: 'sandman', carddefid: 'Sandman' },
{ name: 'sasquatch', carddefid: 'Sasquatch' },
{ name: 'sauron', carddefid: 'Sauron' },
{ name: 'scarlet witch', carddefid: 'ScarletWitch' },
{ name: 'scorpion', carddefid: 'Scorpion' },
{ name: 'sebastian shaw', carddefid: 'SebastianShaw' },
{ name: 'selene', carddefid: 'Selene' },
{ name: 'sentinel', carddefid: 'Sentinel' },
{ name: 'sentry', carddefid: 'Sentry' },
{ name: 'sera', carddefid: 'Sera' },
{ name: 'sersi', carddefid: 'Sersi' },
{ name: 'shadow king', carddefid: 'ShadowKing' },
{ name: 'shang-chi', carddefid: 'ShangChi' },
{ name: 'shanna', carddefid: 'Shanna' },
Expand All @@ -226,13 +281,15 @@ const cardDefIds: CardDef[] = [
{ name: 'silver samurai', carddefid: 'SilverSamurai' },
{ name: 'silver surfer', carddefid: 'SilverSurfer' },
{ name: 'sinister clone', carddefid: 'SinisterClone' },
{ name: 'skaar', carddefid: 'Skaar' },
{ name: 'snowguard', carddefid: 'Snowguard' },
{ name: 'snowguard bear', carddefid: 'SnowguardBear' },
{ name: 'snowguard hawk', carddefid: 'SnowguardHawk' },
{ name: 'snowguard wolf', carddefid: 'SnowguardWolf' },
{ name: 'soul stone', carddefid: 'SoulStone' },
{ name: 'space stone', carddefid: 'SpaceStone' },
{ name: 'spectrum', carddefid: 'Spectrum' },
{ name: 'speed', carddefid: 'Speed' },
{ name: 'spider-ham', carddefid: 'SpiderHam' },
{ name: 'spider-man', carddefid: 'SpiderMan' },
{ name: 'spider-man 2099', carddefid: 'SpiderMan2099' },
Expand All @@ -243,10 +300,12 @@ const cardDefIds: CardDef[] = [
{ name: 'stature', carddefid: 'Stature' },
{ name: 'stegron', carddefid: 'Stegron' },
{ name: 'storm', carddefid: 'Storm' },
{ name: 'stormbreaker', carddefid: 'Stormbreaker' },
{ name: 'strong guy', carddefid: 'StrongGuy' },
{ name: 'stryfe', carddefid: 'Stryfe' },
{ name: 'sunspot', carddefid: 'Sunspot' },
{ name: 'super-skrull', carddefid: 'SuperSkrull' },
{ name: 'supergiant', carddefid: 'Supergiant' },
{ name: 'surtur', carddefid: 'Surtur' },
{ name: 'swarm', carddefid: 'Swarm' },
{ name: 'sword master', carddefid: 'SwordMaster' },
Expand All @@ -260,15 +319,18 @@ const cardDefIds: CardDef[] = [
{ name: 'the phoenix force', carddefid: 'ThePhoenixForce' },
{ name: 'the thing', carddefid: 'TheThing' },
{ name: 'the void', carddefid: 'TheVoid' },
{ name: 'thena', carddefid: 'Thena' },
{ name: 'thor', carddefid: 'Thor' },
{ name: 'tiger spirit', carddefid: 'TigerSpirit' },
{ name: 'time stone', carddefid: 'TimeStone' },
{ name: 'titania', carddefid: 'Titania' },
{ name: 'toad', carddefid: 'Toad' },
{ name: 'typhoid mary', carddefid: 'TyphoidMary' },
{ name: 'u.s. agent', carddefid: 'USAgent' },
{ name: 'uatu the watcher', carddefid: 'Uatu' },
{ name: 'ultron', carddefid: 'Ultron' },
{ name: 'uncle ben', carddefid: 'UncleBen' },
{ name: 'valentina', carddefid: 'Valentina' },
{ name: 'valkyrie', carddefid: 'Valkyrie' },
{ name: 'venom', carddefid: 'Venom' },
{ name: 'vibranium', carddefid: 'Vibranium' },
Expand All @@ -280,9 +342,13 @@ const cardDefIds: CardDef[] = [
{ name: 'warpath', carddefid: 'Warpath' },
{ name: 'wasp', carddefid: 'Wasp' },
{ name: 'wave', carddefid: 'Wave' },
{ name: 'werewolf by night', carddefid: 'WerewolfByNight' },
{ name: 'white queen', carddefid: 'WhiteQueen' },
{ name: 'white tiger', carddefid: 'WhiteTiger' },
{ name: 'white widow', carddefid: 'WhiteWidow' },
{ name: 'wiccan', carddefid: 'Wiccan' },
{ name: "widow's bite", carddefid: 'WidowsBite' },
{ name: "widow's kiss", carddefid: 'WidowsKiss' },
{ name: 'winter soldier', carddefid: 'WinterSoldier' },
{ name: 'witchfire', carddefid: 'Witchfire' },
{ name: 'wolfsbane', carddefid: 'Wolfsbane' },
Expand Down

0 comments on commit 4d2fd5e

Please sign in to comment.