PokemonTCG / pokemon-tcg-api

Pokemon TCG API allows developers to easily consume Pokemon card and set data in JSON format.
61 stars 3 forks source link

Add PTCGO code to set list #13

Closed mattcan closed 6 years ago

mattcan commented 8 years ago

A project I'm working on required translating the set code from PTCGO to set code used in the API. I thought I'd let you know about the lookup table I've created in the event you wanted to add it to the API.

Table: https://gist.github.com/mattcan/d2e5873dcb78849b63e7071218afabf0

adback03 commented 8 years ago

Thanks a lot! I can definitely add the PTCGO codes to the API. Where does one find the codes for a set so that I can keep up to date when new sets are released?

mattcan commented 8 years ago

I really hope to find a better way than this at some point but my process to get the current list was:

  1. Create a new deck in PTCGO
  2. Add a card from one set (if you do multiple, it seems to get buggy between 30 and 40 unique cards)
  3. Hit the export button and copy the abbreviation between the card name and card number

I took a quick look at Bulbapedia but didn't find anything and nothing jumped out from the data files for the game. If I happen across a better source I'll try to remember to update here.

adback03 commented 8 years ago

After scouring the web looking for a place with these codes, I think I finally found one:

http://pkmncards.com/sets/

They look to match up to the ones you found as well!

mattcan commented 8 years ago

Oh perfect, that goes all the way back!

Eein commented 7 years ago

I'm actually running into this on my project as well - I parsed by the full set name instead but i might move it over to something like this using the code instead. Here's my current list as of today - but i'm still making changes as i find issues with importing things from the game:

I'm simply running this to reverse the object keys and values for now. (i'm importing and exporting)

    let ret = {}
    for(let key in this.toCode()){
      ret[json[key]] = key
    }
    return ret

(this.toCode() being the other table) If I move to using set codes (maybe in the next couple days) i'll update here.

https://gist.github.com/Eein/12a004389046f731d63b795984859fb0

mmxxiii commented 7 years ago

Another resource for finding new set codes from an official source is the decklist form found on pokemon,com at http://www.pokemon.com/us/play-pokemon/about/tournaments-rules-and-resources/ They sometimes take a little while to add new sets.

jaymarvels commented 6 years ago

This would be useful. Another resource would be here: http://ptcgohub.com/list-of-expansion-sets

adback03 commented 6 years ago

ptcgoCode has now been added to the Sets resource!

jaymarvels commented 6 years ago

@adback03

Just sense checking some of these and this is what I have initially found:

        "ptcgoCode": "PR",
        "name": "SM Black Star Promos",

Should actually be "PR-SM SM"

        "ptcgoCode": "PR",
        "name": "XY Black Star Promos",

Should actually be "PR-XY"

        "ptcgoCode": "PR",
        "name": "BW Black Star Promos",

Should actually be "PR-BLW"

And then I stopped ;-)

This is my master list which I used before you added this feature:


public static Dictionary<string, string> SetMapping = new Dictionary<string, string>
        {
         { "Base Set", "BS"},
         { "Jungle", "JU"},
         {"Fossil", "FO"},
         {"Base Set 2", "B2"},
         {"Team Rocket", "TR"},
         {"Gym Heroes", "G1"},
         {"Gym Challenge", "G2"},
         {"Neo Genesis", "N1"},
         {"Neo Discovery", "N2"},
         {"Southern Islands", "SI"},
         {"Neo Relevation", "N3"},
         {"Neo Destiny", "N4"},
         {"Legendary Collection", "LC"},
         {"Expedition base set", "EX"},
         {"Aquapolis", "AQ"},
         {"Skyridge", "SK"},
         {"EX Ruby & Sapphire", "RS"},
         {"EX Sandstorm", "SS"},
         {"EX Dragon", "DR"},
         {"EX Team Magma vs Team Aqua", "MA"},
         {"EX Hidden Legends", "HL"},
         {"EX FireRed & LeafGreen", "RG"},
         {"EX Team Rocket Returns", "RR"},
         {"EX Deoxys", "DX"},
         {"EX Emerald", "EM"},
         {"EX Unseen Forces", "UF"},
         {"EX Delta Species ", "DS"},
         {"EX Legend Maker", "LM"},
         {"EX Holon Phantoms", "HP"},
         {"EX Crystal Guardians", "CG"},
         {"EX Dragon Frontiers", "DF"},
         {"EX Power Keepers", "PK"},
         {"Diamond & Pearl", "DP"},
         {"Mysterious Treasures", "MT"},
         {"Secret Wonders", "SW"},
         {"Great Encounters", "GE"},
         {"Majestic Dawn", "MD"},
         {"Legends Awakened", "LA"},
         {"Stormfront", "SF"},
         {"Platinum", "PL"},
         {"Rising Rivals", "RR"},
         {"Supreme Victors", "SV"},
         {"Arceus", "AR"},
         {"Pokemon Rumble", "RM"},
         {"HeartGold & SoulSilver Black Star Promos", "PR-HS"},
         {"HeartGold & SoulSilver", "HS"},
         {"HS Unleashed", "UL"},
         {"HS Undaunted", "UD"},
         {"HS Triumphant", "TM"},
         {"Call of Legends", "CL"},
         {"BW Black Star Promos", "PR-BLW"},
         {"Black & White", "BLW"},
         {"Emerging Powers", "EPO"},
         {"Noble Victories ", "NVI"},
         {"Next Destinies", "NXD"},
         {"Dark Explorers", "DEX"},
         {"Dragons Exalted", "DRX"},
         {"Dragon Vault", "DRV"},
         {"Boundaries Crossed", "BCR"},
         {"Plasma Storm", "PLS"},
         {"Plasma Freeze", "PLF"},
         {"Plasma Blast", "PLB"},
         {"Legendary Treasures", "LTR"},
         {"XY Black Star Promos", "PR-XY"},
         {"Kalos Starter Set", "KSS"},
         {"XY Base Set", "XY"},
         {"Flashfire", "FLF"},
         {"Furious Fists", "FFI"},
         {"Phantom Forces ", "PHF"},
         {"Primal Clash", "PRC"},
         {"Double Crisis", "DCR"},
         {"Roaring Skies", "ROS"},
         {"Ancient Origins", "AOR"},
         {"BREAKthrough", "BKT"},
         {"BREAKpoint", "BKP"},
         {"Generations", "GEN"},
         {"Fates Collide", "FCO"},
         {"Steam Siege", "STS"},
         {"Evolutions", "EVO"},
         {"Sun & Moon", "SUM"},
         {"SM Black Star Promos", "PR-SM SM"},
         {"Guardians Rising", "GRI"},
         {"Burning Shadows", "BUS"},
         //{"Shining Legends"},
         //{"Crimson Invasion"}
        };```
jaymarvels commented 6 years ago

@adback03

Can you confirm you've seen this?

adback03 commented 6 years ago

@jaymarvels thanks I'll take a look!

adback03 commented 6 years ago

These have been addressed. For future reference, where do you usually obtain the codes? I was able to find all of them other than the promo ones.

jaymarvels commented 6 years ago

@adback03

I used this as reference:

//ref: http://ptcgohub.com/list-of-expansion-sets

But I think I manually checked the promos within PTCGO manually.