Any possibility of getting the card numbers used by magiccards.info into the data set? I've noticed that certain card types the numbers don't quite match - Cunning Bandit, for example, is 99 in your data, whereas magiccards.info uses 99a. And of course, the early sets lack a number entirely
Edit - Strike that first bit - that's a fault in my code, not your data.
Any possibility of getting the card numbers used by magiccards.info into the data set? I've noticed that certain card types the numbers don't quite match - Cunning Bandit, for example, is 99 in your data, whereas magiccards.info uses 99a. And of course, the early sets lack a number entirely
Edit - Strike that first bit - that's a fault in my code, not your data.
I don't want to introduce numbers onto cards that didn't have them originally. I know that some of the promo sets I import from magiccards.info have numbers but they are incorrect or invalid (see https://github.com/Sembiance/mtgjson/issues/43)
To 'number' the cards yourself on sets that don't have numbers, you just need to sort them a specific way.
Alrighty... It's turned out to be even more complicated than a colour or two out of sequence in one or two sets, so I've done some digging, and come up with a solution
Basically, the following slightly-more-glaring anomolies exist:
Limited Edition Beta - Badlands is positioned between the green cards and the red cards, and does not appear amongst the other lands
To get around this, and still have the process be automateable, I concocted a small expression language. The ordering of a set is described using a string consisting of square-bracketed clauses, with each clause representing a range of cards. Each clause consists of sub-clauses separated by boolean operators, and contains a type, an operator and a value. here is the most basic form, which applies to most sets:
[C=B][C=U][C=G][C=R][C=W][T%A][T%L]
The first character is the type, and can have a value of:
C = Color
T = Type (Artifact or Land are the only implemented types, since those are the relevant ones for this problem)
N = Name
I = Multiverse ID
The second character is an operator, with the valid values being:
= - Equals
% - Contains
> - Greater than
< - Less than
The third varies according to what the type is:
Type is "C" (Color):
B = Black
U = Blue
G = Green
R = Red
W = White
X = Multicoloured
Type is "T" (Type):
A = Artifact
L = Land
Type is "N" (Name):
Value can be any aribtrary String
Type is "I" (Multiverse ID):
Value is any arbitrary number
More than one Type clause can be included in a range, separated by the following boolean operators:
& - And
| - Or
! - Not
The following example demonstrates that a range should include all cards where Colour is Red, but name is not Crimson Kobolds:
[C=R!N=Crimson Kobolds]
I'll leave implementation up to the reader (mine is very specific to my data structure, although if people are interested I can provide the RegExps I wrote to break it all up). But in case it's useful, here's all the expressions for the un-numbered sets (I'll use set codes rather than names, so I don't have to do a big lookup :P):
For LEA, 2ED, ARN, 5ED, FEM, POR, PO2:
[C=B][C=U][C=G][C=R][C=W][T%A][T%L]
Colour = Black
Colour = Blue
Colour = Green
Colour = Red
Colour = White
Type contains Artefact
Type contains Land
For DRK, MIR, WTH, STH, CHR:
[C=B][C=U][C=G][C=R][C=W][T%A][T%L][C%X]
Colour = Black
Colour = Blue
Colour = Green
Colour = Red
Colour = White
Type contains Artefact
Type contains Land
Colour is Multicoloured (actually more like "Colour contains ','" in my implementation, hence the %)
I've tried without success to import Allsets-x.json into MySQL.
If anyone has managed it could they please advise what "tricks" are required?
Thanks in advance...
I've tried without success to import Allsets-x.json into MySQL.
If anyone has managed it could they please advise what "tricks" are required?
Thanks in advance...
Someone on GitHub has already done this: https://github.com/laxika/MTGJsonConverter
However the repo seems to be gone, you may want to contact them to see if they would provide you the code.
with BFZ and devoid (colorless) cards, perhaps it's time to introduce a 'color identity' key? my users want the devoid cards treated as colored for deckbuilding purposes.
Using jQuery/AJAX, I assume the $.getJSON command allows me to get the info from the file and store it into a Javascript object. (Please correct me if I'm wrong.) My question is how do I reference the info from the object? Is there a hierarchy like (assuming I used magicCard as the object name) magicCard.setname.cardname or similar? Or is it done another way?
Private Mod Note
():
Rollback Post to RevisionRollBack
Play history: Revised through Mirage, then M14 to present.
AllSets.json is 14.3MB, so you really shouldn't be downloading that in the client. for a description of the hierarchy, see http://mtgjson.com/#sets. you can get an individual card like so: `magicCard[setCode].cards.filter(function(card) { return card.name === cardName })[0]`.
edit: there's also AllSets.json, which is simpler, and you can get a card with: `magicCard[cardName]`.
I've just added Battle for Zendikar (BFZ) and Zendikar Expedition (EXP). Note: I'm aware that everywhere but gatherer has 'Expedition' as plural 'Expeditions', but MTGJSON always uses exactly as it is on Gatherer, so.
Assuming this is because the Expedition cards are only printed in English, even though they can appear in international boosters
You're right. It seems it's a new behavior since MTGJSON 3.0.0.
Well, I think it's disturbing for non-english users. For example, a search with the name 'Vue de la canopée' (the french translation of 'Canopy Vista') will retrieve only the 'Canopy Vista' of 'Battle for Zendikar' (because this set have a french translation), not the 'Zendikar Expedition' one. The user will miss a print of this card.
It should be easy enough for anyone who is importing the JSON data into their app/webpage to simply do what I was doing before 3.0.0 which is to copy the foreignNames found on any card in any set to every other instance of that card in all sets.
Sembiance, I noticed a problem in Shadowmoor: the Chinese Trad. fields contain the english names.
Ahh yes, this is messed up on Gatherer too, which is where the non-english language data comes from. It is also messed up on magiccards.info
The presence of 'Chinese Traditional' on Gatherer for Shadowmoor may signal that it was indeed printed in that language, but they just don't have the data for it. On the other hand it may be a gatherer bug entirely and maybe it wasn't printed in that language. Due to this uncertainty I am hesitant to remove it from MTGJSON since right now the presence of those fields denotes whether or not it was printed in those languages. Tricky situation
Heya, I just noticed that the foreignNames field is no longer present in AllCards-X.json. How come? It was populated by the latest translation before and now it is completely missing. Can you please add it back to AllCards-X?
I just need to know the translated name of each card and don't care about in which set it was translated / not translated.
I launched MTGJSON over 2 years ago. Since then my enthusiasm for it has diminished a lot.
I am open to someone else taking over the site, domain and code.
Do not fear, I am not planning on shutting it down, and I will continue to update it for the time being. However, if someone out there is up for taking it over who would continue to update it and run the site, I am open to that. Feel free to come forward and discuss here on the forum or you can e-mail me robert@cosmicrealms.com
That's a real shame, Sembiance.. You've been a real hero to a lot of projects - quite a lot of the apps on here couldn't have happened without you, including mine. Still, burnout happens.
Would anybody here be keen to form some sort of collaborative development team to help him out? I don't have time to take it all on myself, but I could contribute as part of a group...
Private Mod Note
():
Rollback Post to RevisionRollBack
Minouris's Library - Collection manager and deck builder. It's nifty - Check it out!
To post a comment, please login or register a new account.
Any possibility of getting the card numbers used by magiccards.info into the data set?
I've noticed that certain card types the numbers don't quite match - Cunning Bandit, for example, is 99 in your data, whereas magiccards.info uses 99a.And of course, the early sets lack a number entirelyEdit - Strike that first bit - that's a fault in my code, not your data.
Minouris's Library - Collection manager and deck builder. It's nifty - Check it out!
I don't want to introduce numbers onto cards that didn't have them originally. I know that some of the promo sets I import from magiccards.info have numbers but they are incorrect or invalid (see https://github.com/Sembiance/mtgjson/issues/43)
To 'number' the cards yourself on sets that don't have numbers, you just need to sort them a specific way.
Sort order: Blue, Black, Red, Green, White, Multicolor, Artifact, Special Land, Basic Lands
Within each category, sort by name.
oracle.setOrders[0]=Limited Edition Alpha|BUGRWAL
oracle.setOrders[1]=Limited Edition Beta|BUGRWAL
oracle.setOrders[2]=Unlimited Edition|BUGRWAL
oracle.setOrders[3]=Revised Edition|BUGRWAL
oracle.setOrders[4]=Fourth Edition|BUGLRWA
oracle.setOrders[5]=Fifth Edition|BUGRWAL
oracle.setOrders[6]=Arabian Nights|BUGRWAL
oracle.setOrders[7]=Antiquities|ABUGLRW
oracle.setOrders[8]=Legends|BUGRWALX
oracle.setOrders[9]=The Dark|BUGRWALX
oracle.setOrders[10]=Fallen Empires|BUGRWAL
oracle.setOrders[11]=Mirage|BUGRWALX
oracle.setOrders[12]=Visions|BUGRWXAL
oracle.setOrders[13]=Weatherlight|BUGRWALX
oracle.setOrders[14]=Tempest|BUGRWALX
oracle.setOrders[15]=Stronghold|BUGRWALX
oracle.setOrders[16]=Portal|BUGRWAL
oracle.setOrders[17]=Portal Second Age|BUGRWAL
oracle.setOrders[18]=Chronicles|BUGRWALX
Most follow the BUGRWALX order (or just BUGRWAL if no gold cards), but some are slightly different. WTF Fourth Edition!? BUGLRWA? Really?
[card=Jace Beleren]Jace[/card] = Jace
Magic CompRules
Scry Rollover Popups for Google Chrome
The first rule of Cursecatcher is, You do not talk about Cursecatcher.
Minouris's Library - Collection manager and deck builder. It's nifty - Check it out!
Followup question to this - is there a particular internal colour ordering for Gold cards?
Minouris's Library - Collection manager and deck builder. It's nifty - Check it out!
For these unnumbered sets it appears to be always alphabetical.
[card=Jace Beleren]Jace[/card] = Jace
Magic CompRules
Scry Rollover Popups for Google Chrome
The first rule of Cursecatcher is, You do not talk about Cursecatcher.
Cool, thanks for your help
Minouris's Library - Collection manager and deck builder. It's nifty - Check it out!
Basically, the following slightly-more-glaring anomolies exist:
I'll leave implementation up to the reader (mine is very specific to my data structure, although if people are interested I can provide the RegExps I wrote to break it all up). But in case it's useful, here's all the expressions for the un-numbered sets (I'll use set codes rather than names, so I don't have to do a big lookup :P):
Sembiance, do you mind having this here, or do you think I should split it off to another thread?
Minouris's Library - Collection manager and deck builder. It's nifty - Check it out!
[card=Jace Beleren]Jace[/card] = Jace
Magic CompRules
Scry Rollover Popups for Google Chrome
The first rule of Cursecatcher is, You do not talk about Cursecatcher.
Having it here is just fine with me
That's some good work there
Minouris's Library - Collection manager and deck builder. It's nifty - Check it out!
I'm surprised....
R.
http://www.kodingmadesimple.com/2014/12/how-to-insert-json-data-into-mysql-php.html
I personally think it really depends on what framework/language/gadget you're using and what task you're wanting to accomplish in the end.
Someone asked this on Stack Overflow: http://stackoverflow.com/questions/18327093/converting-json-to-a-mysql-table-how-should-the-table-structure-look-like
Someone on GitHub has already done this: https://github.com/laxika/MTGJsonConverter
However the repo seems to be gone, you may want to contact them to see if they would provide you the code.
Someone else also seems to have done this on github: https://github.com/six7zero9/whoo/tree/master/dbloader
edit: there's also AllSets.json, which is simpler, and you can get a card with: `magicCard[cardName]`.
Assuming this is because the Expedition cards are only printed in English, even though they can appear in international boosters
Minouris's Library - Collection manager and deck builder. It's nifty - Check it out!
It should be easy enough for anyone who is importing the JSON data into their app/webpage to simply do what I was doing before 3.0.0 which is to copy the foreignNames found on any card in any set to every other instance of that card in all sets.
Ahh yes, this is messed up on Gatherer too, which is where the non-english language data comes from. It is also messed up on magiccards.info
The presence of 'Chinese Traditional' on Gatherer for Shadowmoor may signal that it was indeed printed in that language, but they just don't have the data for it. On the other hand it may be a gatherer bug entirely and maybe it wasn't printed in that language. Due to this uncertainty I am hesitant to remove it from MTGJSON since right now the presence of those fields denotes whether or not it was printed in those languages. Tricky situation
Whoops, sorry about that. I've added this issue https://github.com/Sembiance/mtgjson/issues/78 to github and will work on getting it added back in.
I am open to someone else taking over the site, domain and code.
Do not fear, I am not planning on shutting it down, and I will continue to update it for the time being. However, if someone out there is up for taking it over who would continue to update it and run the site, I am open to that. Feel free to come forward and discuss here on the forum or you can e-mail me robert@cosmicrealms.com
Would anybody here be keen to form some sort of collaborative development team to help him out? I don't have time to take it all on myself, but I could contribute as part of a group...
Minouris's Library - Collection manager and deck builder. It's nifty - Check it out!