ontehfritz / api.mtgdb.info

Project closing first of August 2015
http://www.mtgdb.info/
MIT License
36 stars 8 forks source link

Import friday night magic cards #83

Open ontehfritz opened 10 years ago

ontehfritz commented 10 years ago

Import all promo cards from friday night magic

AustinYQM commented 9 years ago

Is there an easy way to do this? I mean get the images?

AustinYQM commented 9 years ago

Ok a found out this: http://magiccards.info/query?q=e%3Afnmp%2Fen&v=card&s=cname works.

Now if someone could point me in the direction of a file to imitate I think I can make this happen.

ontehfritz commented 9 years ago

@AustinYQM if you put it in json format I can easily do a bulk insert, example:

{"id":1,"relatedCardId":0,"setNumber":6,"name":"Ankh of Mishra","searchName":"ankhofmishra","description":"Whenever a land enters the battlefield, Ankh of Mishra deals 2 damage to that land's controller.","flavor":"","colors":["None"],"manaCost":"2","convertedManaCost":2,"cardSetName":"Limited Edition Alpha","type":"Artifact","subType":null,"power":0,"toughness":0,"loyalty":0,"rarity":"Rare","artist":"Amy Weber","cardSetId":"LEA","token":false,"promo":false,"rulings":[{"releasedAt":"2004-10-04","rule":"This triggers on any land entering the battlefield. This includes playing a land or putting a land onto the battlefield using a spell or ability."},{"releasedAt":"2004-10-04","rule":"It determines the land's controller at the time the ability resolves. If the land leaves the battlefield before the ability resolves, the land's last controller before it left is used."}],"formats":[{"name":"Legacy","legality":"Legal"},{"name":"Vintage","legality":"Legal"},{"name":"Freeform","legality":"Legal"},{"name":"Prismatic","legality":"Legal"},{"name":"Tribal Wars Legacy","legality":"Legal"},{"name":"Classic","legality":"Legal"},{"name":"Singleton 100","legality":"Legal"},{"name":"Commander","legality":"Legal"}],"releasedAt":"1993-08-05"}

AustinYQM commented 9 years ago

Is there a file within this project with all the JSON already in here incase I run into any questions (like how colors are stored? Is it BLue or U?).

AustinYQM commented 9 years ago

Sorry if these questions are dumb, kind of new to the whole thing, just wanting to learn and help out.

ontehfritz commented 9 years ago

No, the questions are not dumb. You can see all cards by pointing your browser to: http://api.mtgdb.info/cards/ Then save as in your browser.

AustinYQM commented 9 years ago

Sweet. I will try to have these FNM promos done by the end of next week (15th).

Do I need to get all the images as well? Is there a certain file structure I should use for the images?

ontehfritz commented 9 years ago

Hey, I looked at this a little more. Lots of the cards are already in mtgdb.info. If you find one that is missing then you can put it in your JSON file and name the imagine the same as the multiverse ID (no special file structure needed), which can be found looking up the card on the gatherer: http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=21285 Notice the multiverseid.

For cards that do exist just note them down. Just copy and paste the url into a text file like this. https://www.mtgdb.info/cards/21285

Then when you are done I can go through it. I will set the promo flag on these cards to true. Hope that makes sense.

AustinYQM commented 9 years ago

That makes sense. Are we sure thats the best way to do promos however? I mean should promo be a boolean instead of say an Array? Promo["FNM","Tourny","Gameday","Judge","Media Insert"] seems like it may be a better idea? Not to step on any toes.

Edit:

Or something like the formats section since no promo is exclusive.

ontehfritz commented 9 years ago

Cool, over sight on my part that people would want to grab a card by the different promo types. I can add this, so stick with the plan still. Then next week, I will add a promotype field to all the cards. Also maybe, you can send me all the different promo types. If there is more than mentioned in your previous message.

AustinYQM commented 9 years ago

Here are all the ones Magiccards.info lets you search for:

15th Anniversary, Grand Prix, Pro Tour, Game Day, Words, World Cup Qualifiers, Dragon Con, Prerelease Events, Release Events, Launch Parties, Summer of Magic, WPN/Gateway, Champs, THG Tournament, Arena League, FNM, Magic Player Rewards, Super Series, Happy Holidays, Judge Gift, European Land, Guru Land, Asia Pacific Land, Celebration Cards, Media Inserts, Legend Memembership

AustinYQM commented 9 years ago

Also, how do we handle promotional cards that have something different about them (For example Dave Dorman did 15th Anniversery art for char but Adam Rex did all the other art) but don't have another Multiverse id (For example those two versions of char. only one appears on gatherer as far as I can tell).

AustinYQM commented 9 years ago

Also what about cards like acidic slime that have multiple ids?

ontehfritz commented 9 years ago

@AustinYQM multiple images for now we can use the main art, however lets get the alternative art still, I will think later how to handles this. But, short thought is we can name special promo card images as, [mulitverseid]_fnm.jpg so if I card is in a promo, it could potentially have an image for it.

For multiple ids, We can handle it two ways, either included it on all the version, or figure out what set the promo was for and link it to that card of the particular set.

@AustinYQM Thanks for the list of promos! I will also include a web method to get a list of promos

AustinYQM commented 9 years ago

OK. I have been saving all the FNM images as (originalmultiid)_FNM. And here is what the file looks like:

notepad screenshot

The last id is always the ID the of the card released directly before the promotional card.

If different art is used there is a note. The note only exists if the artist changes. (There is not a note for border or card frame changes).

Is this a good way to go about it or should I take another route? I am about 1/8th through so now is the time to refine the process.

ontehfritz commented 9 years ago

@AustinYQM nice man, thanks for the work on this, you can give me the card/multiverseId of the card at release, no need for them all. I can always go back later and add it to the other cards if planeswalkers decide it is better that way.

AustinYQM commented 9 years ago

I feel like the best way would be to make them their own set, that why "Promo" would appear on the lists of sets it was printed in. The only problem with that would be making up our own ID system for them, though PRO###### or even FNM######, GMD###### ect might work. I will, however, continue to do it that way until told otherwise.

ontehfritz commented 9 years ago

This makes the system too complex from a database point of view (creating even more redundant data), I can still accomplish what you state, by having the promos field ;) Having the promos field makes things more neat then dividing all promo cards out into our own sets, especially if a card exists in more than one promo.

AustinYQM commented 9 years ago

Cool beans. I should have all the FNM ones done by the end of the week, then I will start on the other promo categories :).

ontehfritz commented 9 years ago

Excellent man! :+1:

AustinYQM commented 9 years ago

Getting a 502 when I try and goto https://www.mtgdb.info/. making it hard to do this work, whats up?

AustinYQM commented 9 years ago

and its back

ontehfritz commented 9 years ago

Sorry about that. We can reduce the size of this thread by hitting me up at: planeswalker@mtgdb.info ;)