Okay, that all seems pretty sensible. I'm working on a Java library for Magic cards, and right now I skip all the cards in Promo Set for Gatherer unless they don't have any other printings. (Although now I'm skipping Giant Badger and Arena! Maybe I'll just have to hard-code some stuff... grumble.)
Here's a question for you: If a card has multiple variations in a set, does each variation have its own unique collector's number as well (within the confines of the given set)?
Here's a question for you: If a card has multiple variations in a set, does each variation have its own unique collector's number as well (within the confines of the given set)?
Yes, they do.
For example, if you look at M14.json you'll see four "Forest" entries. Each with a different "number", "imageName" and "multiverseid"
Oh yeah, there was another thing I was thinking about: do you think it would be a good idea to have a "block" attribute for the sets that are classified as expansions, to show which block they belong to?
Oh yeah, there was another thing I was thinking about: do you think it would be a good idea to have a "block" attribute for the sets that are classified as expansions, to show which block they belong to?
There already is a 'block' attribute that shows this information, it is part of each 'set' object.
For example, the BNG.json file has an attribute: "block" : "Theros"
Sembiance, tha order of the cards in the 'all' json is guaranteed to be the same every time? This is pretty serious question because otherwise I need to reorder the cardid-s via the multiverseid. (Synchronise the old and new database ids at every update.) I can do the synchronisation if needed but if the order is always the same I would do something else instead.
Sembiance, tha order of the cards in the 'all' json is guaranteed to be the same every time? This is pretty serious question because otherwise I need to reorder the cardid-s via the multiverseid. (Synchronise the old and new database ids at every update.) I can do the synchronisation if needed but if the order is always the same I would do something else instead.
Hello
I sort the cards first card name. Then for card names that are the same (Forest) I sort by imageName (so forest1 appears before forest2) then finally if for some odd reason those are the same I sort on collector's number.
Based on this, the cards should always be in the same order.
I can't guarantee that though. I don't have any tests that ensure the order is the same every time I publish updates.
If I were in your position, I wouldn't rely on order always being the same. You just never know what might happen. In past projects I've learned that relying on the order of imported data to be the same is always asking for trouble, and it's always better to use some sort of unique identifier from the records themselves, even if it is a little bit more work. Just my thoughts
Sembiance, tha order of the cards in the 'all' json is guaranteed to be the same every time? This is pretty serious question because otherwise I need to reorder the cardid-s via the multiverseid. (Synchronise the old and new database ids at every update.) I can do the synchronisation if needed but if the order is always the same I would do something else instead.
Hello
I sort the cards first card name. Then for card names that are the same (Forest) I sort by imageName (so forest1 appears before forest2) then finally if for some odd reason those are the same I sort on collector's number.
Based on this, the cards should always be in the same order.
I can't guarantee that though. I don't have any tests that ensure the order is the same every time I publish updates.
If I were in your position, I wouldn't rely on order always being the same. You just never know what might happen. In past projects I've learned that relying on the order of imported data to be the same is always asking for trouble, and it's always better to use some sort of unique identifier from the records themselves, even if it is a little bit more work. Just my thoughts
Thanks for the answer!
If something is not guaranteed I would never trust in it. Then at an update I'll query the database id via the multiverseid from the old database and just use that as an id.
Also I think it would be cool if you add this to the documentation (if you have the time to do so).
I'm working on an auction site so the id's must match after each update.
I sort the cards first card name. Then for card names that are the same (Forest) I sort by imageName (so forest1 appears before forest2) then finally if for some odd reason those are the same I sort on collector's number.
Also I think it would be cool if you add this to the documentation (if you have the time to do so).
Thank you SO much for this resource, Sembiance. I´m doing a little side project and this dataset saved me a lot of time. Really, thank you for your time doing this.
Added format legalities to every card. So you can now tell which play formats a card is legal, restricted or banned in.
I also updated the version number to 2.0.0
The first number (major version) won't likely be increasing. Going forward the middle number (minor version) will update whenever a new set is added. The last number will update whenever I do little bug fixes or typos, etc.
Do you ever plan on changing any of the expansion codes of any of the sets? Or do you plan on having a "multiverseid" equivalent for expansions in the future (i.e. a unique identifier for an expansion)?
Do you ever plan on changing any of the expansion codes of any of the sets? Or do you plan on having a "multiverseid" equivalent for expansions in the future (i.e. a unique identifier for an expansion)?
I never plan on changing the expansion codes, no.
There are a few codes that are 'not official' because they are not on gatherer.
In theory if WotC ever puts these sets up on gatherer, and they use a different code, I'll probably switch to the official code. This is the only way I see the codes ever changing.
For reference, the sets that have unofficial codes:
* Happy Holidays (HHO)
* Anthologies (ATH)
* Rivals Quick Start Set (RQS)
* Introductory Two-Player Set (ITP)
* Deckmasters (DKM)
Is there a possibility that you implement a way of scrapping prices from shops websites ?
any sort of "template script" allowing to easily recover card price from different websites ?
Hello
I do not plan on adding pricing information to MTGJSON.
However, there are some other API's that provide this data, such as DeckBrew: http://deckbrew.com/api/
Any plans to document aliases of illustrators? This is something I've been interested in and I actually have a good first-take of every artist and his/her known aliases (and non-aliases) if you're interested.
In my database of aliases, I have things like this:
Alias #1: Abyssal Protector is illustrated by Chippy, who happens to have collaborated with Matthew Wilson for the artwork of Disease Carriers
Alias #2: Matthew Wilson is the same person as Matthew D. Wilson (proof: http://mattwilsonprime.com/)
Alias #3: Ron Spears is the same person as Ron "Don't You Dare Change Me" Spears
Alias #4: Dennis Detwiller is the same person as Dennis Detwiler (misspelling)
Alias #5: Denise Detwiler is the same person as Dennis Detwiller (misspelling, proof: http://wiki.mtgsalvation.com/article/The_Dark#Misprints)
I also have things like this:
Non-Alias #1: Yang Hong is not the same person as Hong Yan
etc...
Thanks Sembiance,
I have a little problem in running your code:
...
Have an idea ?
Thanks a lot
I just updated the code to fix this. Basically, the 'cheerio' module updated and broke my code, but my local dev copy was still running the older version, so it worked fine.
You will need to:
git pull
rm -rf node_modules
npm install
cd node_modules
ln -s ../shared/C.js
ln -s ../shared/shared.js
I updated the README.md with the symlink steps too.
I just tested here and now it works fine, so it should work for you
Private Mod Note
():
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Yes, they do.
For example, if you look at M14.json you'll see four "Forest" entries. Each with a different "number", "imageName" and "multiverseid"
There already is a 'block' attribute that shows this information, it is part of each 'set' object.
For example, the BNG.json file has an attribute: "block" : "Theros"
Hello
I sort the cards first card name. Then for card names that are the same (Forest) I sort by imageName (so forest1 appears before forest2) then finally if for some odd reason those are the same I sort on collector's number.
Based on this, the cards should always be in the same order.
I can't guarantee that though. I don't have any tests that ensure the order is the same every time I publish updates.
If I were in your position, I wouldn't rely on order always being the same. You just never know what might happen. In past projects I've learned that relying on the order of imported data to be the same is always asking for trouble, and it's always better to use some sort of unique identifier from the records themselves, even if it is a little bit more work. Just my thoughts
Thanks for the answer!
If something is not guaranteed I would never trust in it. Then at an update I'll query the database id via the multiverseid from the old database and just use that as an id.
Also I think it would be cool if you add this to the documentation (if you have the time to do so).
I'm working on an auction site so the id's must match after each update.
Added to the docs.
No problem! Glad it you are finding it useful
Added format legalities to every card. So you can now tell which play formats a card is legal, restricted or banned in.
I also updated the version number to 2.0.0
The first number (major version) won't likely be increasing. Going forward the middle number (minor version) will update whenever a new set is added. The last number will update whenever I do little bug fixes or typos, etc.
Enjoy everyone
Also updated Anthologies to have much more accurate originalText, originalType, flavor and artist fields.
Lastly, fixed a few very minor issues in some other sets.
According to http://wiki.mtgsalvation.com/article/Rivals_Quick_Start_Set:
So, you could just make a copy of those 112 4th edition cards and put them into the RQS directory.
I never plan on changing the expansion codes, no.
There are a few codes that are 'not official' because they are not on gatherer.
In theory if WotC ever puts these sets up on gatherer, and they use a different code, I'll probably switch to the official code. This is the only way I see the codes ever changing.
For reference, the sets that have unofficial codes:
* Happy Holidays (HHO)
* Anthologies (ATH)
* Rivals Quick Start Set (RQS)
* Introductory Two-Player Set (ITP)
* Deckmasters (DKM)
Right you are! Not sure how I missed that because I was looking at the exact page on and off all day today.
I've just updated mtgjson to include the imageName in RQS.
I'll be updating mtgimage with the actual images shortly.
Thanks
It happens to the best of us! Thank you for all the hard work!
I do not provide an XML version of the card data, only JSON.
Whatever language you are using to read the XML should also have libraries available to read the JSON?
Hello
I do not plan on adding pricing information to MTGJSON.
However, there are some other API's that provide this data, such as DeckBrew: http://deckbrew.com/api/
In my database of aliases, I have things like this:
Alias #1: Abyssal Protector is illustrated by Chippy, who happens to have collaborated with Matthew Wilson for the artwork of Disease Carriers
Alias #2: Matthew Wilson is the same person as Matthew D. Wilson (proof: http://mattwilsonprime.com/)
Alias #3: Ron Spears is the same person as Ron "Don't You Dare Change Me" Spears
Alias #4: Dennis Detwiller is the same person as Dennis Detwiler (misspelling)
Alias #5: Denise Detwiler is the same person as Dennis Detwiller (misspelling, proof: http://wiki.mtgsalvation.com/article/The_Dark#Misprints)
I also have things like this:
Non-Alias #1: Yang Hong is not the same person as Hong Yan
etc...
http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=26416
Can you fix this, or I should fix it on my side? (I think the second one should be dropped.)
I just updated the code to fix this. Basically, the 'cheerio' module updated and broke my code, but my local dev copy was still running the older version, so it worked fine.
You will need to:
I updated the README.md with the symlink steps too.
I just tested here and now it works fine, so it should work for you