M14 is on gatherer; get it updated to CT?

Rob Dennis

Developer
http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=370692

you can get it programmatically using tutor (I contributed to the CLI portion and used it to import to my database):
Code:
bin/tutor card "Trained Condor" --format json
{"converted_mana_cost":3,"supertypes":[],"types":["Creature"],"subtypes":["Bird"],"rulings":[],"name":"Trained Condor","mana_cost":"{2}{U}","text":"Flying\n\nWhenever Trained Condor attacks, another target creature you control gains flying until end of turn.","power":2,"toughness":1,"community_rating":{"rating":3.667,"votes":6},"languages":{"zh-CN":{"name":"馴使兀鷹","ids":[371190]},"de":{"name":"Gezähmter Kondor","ids":[371439]},"fr":{"name":"Condor dressé","ids":[371688]},"it":{"name":"Condor Addestrato","ids":[371937]},"ja":{"name":"訓練されたコンドル","ids":[372186]},"kr":{"name":"훈련받은 콘도르","ids":[372435]},"ru":{"name":"Дрессированный Кондор","ids":[372933]},"zh-TW":{"name":"驯使兀鹰","ids":[370941]},"pt-BR":{"name":"Condor Treinado","ids":[372684]},"es":{"name":"Cóndor entrenado","ids":[373182]}},"legality":{},"versions":{"370692":{"expansion":"Magic 2014 Core Set","rarity":"Common"}}}

Code:
bin/tutor set "Magic 2014 Core Set" --format json
<A LOT OF OUTPUT THAT'S EVERY CARD IN M14>

I can assist with getting node setup if that's a want
 

lebenski

CubeTutor Developer
This looks cool Rob! I have something similar that grabs the cards from MagicCards.info albeit with a bit less information. I just ran it and the problem I'm having with M14 is that the images aren't hosted in the usual place:

http://www.wizards.com/global/images/magic/general/wind_drake.jpg
http://www.wizards.com/global/images/magic/general/charging_griffin.jpg

or even:

http://www.wizards.com/global/images/magic/dgm/wind_drake.jpg
http://www.wizards.com/global/images/magic/m14/charging_griffin.jpg

It might just be that they are being a bit late updating these URLs or maybe something has changed. Any thoughts?
 

lebenski

CubeTutor Developer
Thanks a lot for that Eric, I wasn't aware of it's existence! I'm not sure if Wizards have ever published a doc showing how to access images like this? If so I haven't found it. The only reason I've been using the wizards.com URL is because it's the only one I'd found that can reliably provide card images on a URL that is discoverable without knowing Gatherer IDs.

I haven't posted my MagicCards.info scraper publicly because it is so tightly coupled to my code. For each card it finds it checks that the card doesnt already exist in my DB, if it doesnt then it System.outs a line with the DB insert that I need. That way I can just rerun it to find new fnm promos etc. It actually uses MagicCards.info to collect the card names and Gatherer to get the text in a very convoluted way. I'm certain that your method is much cleaner Rob! However I will email across my implementation for your reference, but please just be aware it is highly hacked together and very specific for my use case!

Sorry I've been slack on the replies the last few days. I've been on a family vacation to a holiday village in the forest called Center Parcs (not sure what the American equivalent would be), and the wifi is patchy to say the least! When I get home tonight I'll hopefully be putting out a fairly sizable release.
 

lebenski

CubeTutor Developer
Looks like they got around to adding the cards to the general URL and they are now up on the site.
 

Rob Dennis

Developer
Sorry I've been slack on the replies the last few days. I've been on a family vacation to a holiday village in the forest called Center Parcs (not sure what the American equivalent would be), and the wifi is patchy to say the least! When I get home tonight I'll hopefully be putting out a fairly sizable release.


This is the time of year for those holidays, for sure. And I did get the scraper email and saw the release, so great job :)
 

lebenski

CubeTutor Developer
Hey Ben, I've been using the "secret" Gatherer API for my own deck layouts. Maybe this would be useful to you too. Compared to the URLs you specified, this one does come with an ugly border, so you'd have to crop that.

http://gatherer.wizards.com/Handlers/Image.ashx?type=card&name=wind drake
http://gatherer.wizards.com/Handlers/Image.ashx?type=card&name=charging griffin

Eric, any idea if this takes another parameter that I can use to specify the set too? If so it would be PERFECT!

Or if you could point me in the direction of any kind of documentation, that would be good too.
 

Eric Chan

Hyalopterous Lemure
Staff member
Hoo boy. I don't know really know much more than what I've already posted. I don't think that gatherer API is officially documented anywhere, unfortunately. The most I could find was this discussion, which confirms its lack of documentation.

We better call in the big guns. Rob! Do you know anything about this super secret API?
 

Rob Dennis

Developer
some testing shows that:
http://gatherer.wizards.com/Handlers/Image.ashx?type=card&name=act of treason shows the M14 picture, as I'd expect since it's newest
http://gatherer.wizards.com/Handlers/Image.ashx?type=card&name=act of treason&set=GTC shows the gatecrash picture, as I'd expect since we specified

however, I don't know if there's a canonical list of the set initials.
Cube tutor does show those initials when you add a card, but that may/may not match up to what gatherer shows since you probably got them from magiccards.info

For example, you have "GPX" which I *believe* is the Grand Prix releases, and that doesn't seem to work:
http://gatherer.wizards.com/Handlers/Image.ashx?type=card&name=goblin guide&set=GPX
even though it does exist on magiccards.info: http://magiccards.info/gpx/en/6.html
 

lebenski

CubeTutor Developer

Rob Dennis

Developer
so, super necromancy and I'm sure this isn't 100% new information, but taking a look at magiccards.info, they have everything laid out in a tree like this:

~/scans/<language_abbreviation>/<set_abbreviation>/<collector_number>
e.g.
http://magiccards.info/scans/en/gtc/215.jpg
is Boros Reckoner

so, set abbreviation would need to be hard coded, but collector number is a public part of the card and can be pulled from a dump of gatherer for everything that is in that database. This is *slightly* less annoying than having to save off a "magiccards.info" number.

The caveat about the database does mean that you still don't get promos as part of the same system
 
Top