Skip to content

Instantly share code, notes, and snippets.

@mfrancois3k
Forked from JRHeaton/yugiohlist.js
Created May 30, 2024 16:32
Show Gist options
  • Save mfrancois3k/f3f25a7a669d8f3d501d93ac5fa8c763 to your computer and use it in GitHub Desktop.
Save mfrancois3k/f3f25a7a669d8f3d501d93ac5fa8c763 to your computer and use it in GitHub Desktop.

Revisions

  1. @JRHeaton JRHeaton revised this gist Jan 3, 2015. 1 changed file with 7 additions and 6 deletions.
    13 changes: 7 additions & 6 deletions yugiohlist.js
    Original file line number Diff line number Diff line change
    @@ -9,18 +9,19 @@ request('http://www.yugioh-card.com/en/limited/', function (err, res, body) {

    var cards = []

    $('#colfull_main table tr').each(function (i, elem) {
    $('#colfull_main table tr')
    .filter(function (i, e) {
    return $(e).children('td').first().text() != "Card Type"
    && ($(e).children().length == 4 || $(e).children().length == 5)
    })
    .each(function (i, elem) {
    var data = $(elem)
    .children('td')
    .map(function (ii, e) {
    return $(e).text()
    })
    .get()

    if (data.length != 4 && data.length != 5 || data[0] == "Card Type") {
    return
    }

    cards.push({
    "type" : data[0],
    "name" : data[1].replace(/\s+/g, ' '),
    @@ -32,7 +33,7 @@ request('http://www.yugioh-card.com/en/limited/', function (err, res, body) {
    println(JSON.stringify(cards, null, ' '))
    })

    /* Sample output (As of Jan 2, 2015)
    /* Sample output (As of Jan 3, 2015)
    [
    {
  2. @JRHeaton JRHeaton revised this gist Jan 3, 2015. 1 changed file with 439 additions and 1 deletion.
    440 changes: 439 additions & 1 deletion yugiohlist.js
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ request('http://www.yugioh-card.com/en/limited/', function (err, res, body) {
    })
    .get()

    if (data.length != 4) {
    if (data.length != 4 && data.length != 5 || data[0] == "Card Type") {
    return
    }

    @@ -35,6 +35,444 @@ request('http://www.yugioh-card.com/en/limited/', function (err, res, body) {
    /* Sample output (As of Jan 2, 2015)
    [
    {
    "type": "Monster/Effect",
    "name": "BURNER, DRAGON RULER OF SPARKS",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "CHAOS EMPEROR DRAGON - ENVOY OF THE END",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "CYBER JAR",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "CYBER-STEIN",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "DARK MAGICIAN OF CHAOS",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "DESTINY HERO - DISK COMMANDER",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "ELEMENTAL HERO STRATOS",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "FIBER JAR",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "FISHBORG BLASTER",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "LIGHTNING, DRAGON RULER OF DRAFTS",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "MAGICAL SCIENTIST",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "MAKYURA THE DESTRUCTOR",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "MIND MASTER",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "MORPHING JAR",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "MORPHING JAR #2",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "REACTAN, DRAGON RULER OF PEBBLES",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "RESCUE CAT",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "SANGAN",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "SINISTER SERPENT",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "STREAM, DRAGON RULER OF DROPLETS",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "SUBSTITOAD",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "TRIBE-INFECTING VIRUS",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "VICTORY DRAGON",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "WITCH OF THE BLACK FOREST",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "YATA-GARASU",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Fusion",
    "name": "THOUSAND-EYES RESTRICT",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Synchro",
    "name": "BRIONAC, DRAGON OF THE ICE BARRIER",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Synchro",
    "name": "TRISHULA, DRAGON OF THE ICE BARRIER",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Xyz",
    "name": "NUMBER 16: SHOCK MASTER",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster/Xyz",
    "name": "WIND-UP CARRIER ZENMAITY",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "BRAIN CONTROL",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "BUTTERFLY DAGGER - ELMA",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "CARD DESTRUCTION",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "CARD OF SAFE RETURN",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "CHANGE OF HEART",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "COLD WAVE",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "CONFISCATION",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "DELINQUENT DUO",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "DIMENSION FUSION",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "DRAGON RAVINE",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "FUTURE FUSION",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "GATEWAY OF THE SIX",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "GIANT TRUNADE",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "GRACEFUL CHARITY",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "HARPIE'S FEATHER DUSTER",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "HEAVY STORM",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "LAST WILL",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "MASS DRIVER",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "METAMORPHOSIS",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "MIRAGE OF NIGHTMARE",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "MONSTER REBORN",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "PAINFUL CHOICE",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "POT OF AVARICE",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "POT OF GREED",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "PREMATURE BURIAL",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "SPELLBOOK OF JUDGMENT",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "SUPER POLYMERIZATION",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "SUPER REJUVENATION",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "TEMPLE OF THE KINGS",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Spell",
    "name": "THE FORCEFUL SENTRY",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Trap",
    "name": "CRUSH CARD VIRUS",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Trap",
    "name": "EXCHANGE OF THE SPIRIT",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Trap",
    "name": "IMPERIAL ORDER",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Trap",
    "name": "LAST TURN",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Trap",
    "name": "RETURN FROM THE DIFFERENT DIMENSION",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Trap",
    "name": "RING OF DESTRUCTION",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Trap",
    "name": "ROYAL OPPRESSION",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Trap",
    "name": "SELF-DESTRUCT BUTTON",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Trap",
    "name": "SIXTH SENSE",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Trap",
    "name": "SOLEMN JUDGMENT",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Trap",
    "name": "TIME SEAL",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Trap",
    "name": "TRAP DUSTSHOOT",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Trap",
    "name": "ULTIMATE OFFERING",
    "status": "Forbidden",
    "comment": "Limited"
    },
    {
    "type": "Monster",
    "name": "LEFT ARM OF THE FORBIDDEN ONE",
  3. @JRHeaton JRHeaton revised this gist Jan 2, 2015. 1 changed file with 535 additions and 1 deletion.
    536 changes: 535 additions & 1 deletion yugiohlist.js
    Original file line number Diff line number Diff line change
    @@ -30,4 +30,538 @@ request('http://www.yugioh-card.com/en/limited/', function (err, res, body) {
    })

    println(JSON.stringify(cards, null, ' '))
    })
    })

    /* Sample output (As of Jan 2, 2015)
    [
    {
    "type": "Monster",
    "name": "LEFT ARM OF THE FORBIDDEN ONE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster",
    "name": "LEFT LEG OF THE FORBIDDEN ONE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster",
    "name": "RIGHT ARM OF THE FORBIDDEN ONE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster",
    "name": "RIGHT LEG OF THE FORBIDDEN ONE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "ARTIFACT MORALLTACH",
    "status": "Limited",
    "comment": "New"
    },
    {
    "type": "Monster/Effect",
    "name": "ATLANTEAN DRAGOONS",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "BLACK LUSTER SOLDIER - ENVOY OF THE BEGINNING ",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "BLASTER, DRAGON RULER OF INFERNOS",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "BROTHERHOOD OF THE FIRE FIST - SPIRIT",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "DANDYLION",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "DARK ARMED DRAGON",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "DEBRIS DRAGON",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "DEEP SEA DIVA",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "EXODIA THE FORBIDDEN ONE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "GENEX ALLY BIRDMAN",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "GLADIATOR BEAST BESTIARI",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "GLOW-UP BULB",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "INFERNITY ARCHFIEND",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "INZEKTOR DRAGONFLY",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "INZEKTOR HORNET",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "NEO-SPACIAN GRAND MOLE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "NIGHT ASSAILANT",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "RED-EYES DARKNESS METAL DRAGON",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "REDOX, DRAGON RULER OF BOULDERS",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "RESCUE RABBIT",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "TEMPEST, DRAGON RULER OF STORMS",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "THUNDER KING RAI-OH",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "TIDAL, DRAGON RULER OF WATERFALLS",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "WIND-UP MAGICIAN",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Ritual",
    "name": "EVIGISHKI GUSTKRAKEN",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Ritual",
    "name": "EVIGISHKI MIND AUGUS",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Synchro",
    "name": "DARK STRIKE FIGHTER",
    "status": "Limited",
    "comment": "Was Forbidden"
    },
    {
    "type": "Monster/Synchro",
    "name": "DEWLOREN, TIGER KING OF THE ICE BARRIER",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Synchro",
    "name": "LEGENDARY SIX SAMURAI - SHI EN",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Synchro",
    "name": "T.G. HYPER LIBRARIAN",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "ALLURE OF DARKNESS",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "BOOK OF MOON",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "BURIAL FROM A DIFFERENT DIMENSION",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "CHARGE OF THE LIGHT BRIGADE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "DIMENSIONAL FISSURE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "DIVINE WIND OF MIST VALLEY",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "FINAL COUNTDOWN",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "FOOLISH BURIAL",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "GOLD SARCOPHAGUS",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "INFERNITY LAUNCHER",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "LIMITER REMOVAL",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "MIND CONTROL",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "MONSTER GATE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "ONE DAY OF PEACE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "ONE FOR ONE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "RAIGEKI",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "REKINDLING",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "ROYAL TRIBUTE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "SACRED SWORD OF SEVEN STARS",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "SNATCH STEAL",
    "status": "Limited",
    "comment": "Was Forbidden"
    },
    {
    "type": "Spell",
    "name": "SOUL CHARGE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "SPELLBOOK OF FATE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Trap",
    "name": "BOTTOMLESS TRAP HOLE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Trap",
    "name": "COMPULSORY EVACUATION DEVICE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Trap",
    "name": "ERADICATOR EPIDEMIC VIRUS",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Trap",
    "name": "GEARGIAGEAR",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Trap",
    "name": "INFERNITY BARRIER",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Trap",
    "name": "MACRO COSMOS",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Trap",
    "name": "MAGICAL EXPLOSION",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Trap",
    "name": "SOLEMN WARNING",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Trap",
    "name": "SOUL DRAIN",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Trap",
    "name": "TORRENTIAL TRIBUTE",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Trap",
    "name": "WALL OF REVEALING LIGHT",
    "status": "Limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "CARD TROOPER",
    "status": "Semi-limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "CHAOS SORCERER",
    "status": "Semi-limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "GORZ THE EMISSARY OF DARKNESS",
    "status": "Semi-limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "HONEST",
    "status": "Semi-limited",
    "comment": "Was Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "LONEFIRE BLOSSOM",
    "status": "Semi-limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "NECROFACE",
    "status": "Semi-limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "SUMMONER MONK",
    "status": "Semi-limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "TRAGOEDIA",
    "status": "Semi-limited",
    "comment": ""
    },
    {
    "type": "Monster/Synchro",
    "name": "GOYO GUARDIAN",
    "status": "Semi-limited",
    "comment": "Was Limited"
    },
    {
    "type": "Spell",
    "name": "ADVANCED RITUAL ART",
    "status": "Semi-limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "CHAIN STRIKE",
    "status": "Semi-limited",
    "comment": ""
    },
    {
    "type": "Spell",
    "name": "DARK HOLE",
    "status": "Semi-limited",
    "comment": "Was Limited"
    },
    {
    "type": "Spell",
    "name": "HIERATIC SEAL OF CONVOCATION",
    "status": "Semi-limited",
    "comment": ""
    },
    {
    "type": "Trap",
    "name": "CEASEFIRE",
    "status": "Semi-limited",
    "comment": ""
    },
    {
    "type": "Trap",
    "name": "OJAMA TRIO",
    "status": "Semi-limited",
    "comment": ""
    },
    {
    "type": "Monster/Effect",
    "name": "BLACKWING - GALE THE WHIRLWIND",
    "status": "No longer on list",
    "comment": "Was Semi-Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "MERMAIL ABYSSGUNDE",
    "status": "No longer on list",
    "comment": "Was Limited"
    },
    {
    "type": "Monster/Effect",
    "name": "REBORN TENGU",
    "status": "No longer on list",
    "comment": "Was Semi-Limited"
    },
    {
    "type": "Spell",
    "name": "REASONING",
    "status": "No longer on list",
    "comment": "Was Semi-Limited"
    },
    {
    "type": "Trap",
    "name": "THE TRANSMIGRATION PROPHECY",
    "status": "No longer on list",
    "comment": "Was Semi-Limited"
    }
    ]
    */
  4. @JRHeaton JRHeaton revised this gist Jan 2, 2015. 1 changed file with 12 additions and 7 deletions.
    19 changes: 12 additions & 7 deletions yugiohlist.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    var _ = require('underscore')
    var _ = require('underscore')
    var cheerio = require('cheerio')
    var request = require('request')

    @@ -10,19 +10,24 @@ request('http://www.yugioh-card.com/en/limited/', function (err, res, body) {
    var cards = []

    $('#colfull_main table tr').each(function (i, elem) {
    var data = $(elem).children('td')
    var data = $(elem)
    .children('td')
    .map(function (ii, e) {
    return $(e).text()
    })
    .get()

    if (data.length != 4) {
    return
    }

    cards.push({
    "type" : data[0],
    "name" : data[1].replace(/\s+/g, ' '),
    "status" : data[2],
    "comment" : data[3]
    "type" : data[0],
    "name" : data[1].replace(/\s+/g, ' '),
    "status" : data[2],
    "comment" : data[3].trim()
    })
    })

    println(JSON.stringify(cards, null, '\t'))
    println(JSON.stringify(cards, null, ' '))
    })
  5. @JRHeaton JRHeaton created this gist Jan 2, 2015.
    28 changes: 28 additions & 0 deletions yugiohlist.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    var _ = require('underscore')
    var cheerio = require('cheerio')
    var request = require('request')

    var println = console.log

    request('http://www.yugioh-card.com/en/limited/', function (err, res, body) {
    var $ = cheerio.load(body)

    var cards = []

    $('#colfull_main table tr').each(function (i, elem) {
    var data = $(elem).children('td')
    .map(function (ii, e) {
    return $(e).text()
    })
    .get()

    cards.push({
    "type" : data[0],
    "name" : data[1].replace(/\s+/g, ' '),
    "status" : data[2],
    "comment" : data[3]
    })
    })

    println(JSON.stringify(cards, null, '\t'))
    })