2019 Holiday Exchange!
 
A New and Exciting Beginning
 
The End of an Era
  • posted a message on Minouris's Library - Collection Manager and Deck Builder (Massive deck builder update!)
    Commander 2015 has been added to the site Smile

    Kudos to @andarilhomtg for keeping MTGJSON maintained, so I could get it up so quickly Smile
    Posted in: Third Party Products
  • posted a message on MTG JSON - New website provides MTG card data in JSON format
    Quote from mrkristopher »
    The nice people at Stack Overflow (Stack Exchange) got it working. The correct PHP code for accessing the first card name in the JSON file is:

    $jsondata = file_get_contents('BFZ.json');
    $data = json_decode($jsondata, true);
    $cards = $data['cards'][0]['name'];
    echo $cards;

    I'm going to put together some loops and insert it all into a MySQL database. Woo.


    Note that not all fields are set for each record, as well (or at least that used to be the case) - the following saved me a lot of grief when I first started using this with PHP:

    function ifPropertyExists($object, $propertyName, $altValue) {
    	if (is_object($object)) {
    		if (property_exists($object, $propertyName)) {
    			return $object->{$propertyName};
    		} else {
    			return $altValue;
    		}
    	} else if ((array) $object === $object) {
    		if (isset($object[$propertyName])) {
    			return $object[$propertyName];
    		} else {
    			return $altValue;
    		}
    	}
    }


    Works for both object and array decided versions of the data Smile
    Posted in: Third Party Products
  • posted a message on MTG JSON - New website provides MTG card data in JSON format
    For some bizarro reason, in the Clash Pack both Temple of Mystery and Courser of Kruphix are numbered as #6 in the set. I've checked the card art, and this is on the card as well (card printing error, maybe?).

    Technically correct, but obviously causes some issues when getting the image from MagicCards.info, which has Courser as #12. Not sure whether this is the place to fix it, or whether ths should just be here as an FYI for the people who need to be aware of it.
    Posted in: Third Party Products
  • posted a message on MTG JSON - New website provides MTG card data in JSON format
    Sorry folks, my face is covered in egg (bonus: it's covering up that embarassed red hue). I did some tests, and couldn't reproduce the duplicate IDs I saw before. I'll just be crawling back to my hole Wink
    Posted in: Third Party Products
  • posted a message on MTG JSON - New website provides MTG card data in JSON format
    id is the one I mean, yes - sorry, getting my terminology mixed up.

    I'll stick some more checks in my code, to be sure, and try to run an independent simulation (without so may moving parts), to see if I can come up with some concrete examples.

    Not trying to ruffle any feathers here Smile
    Posted in: Third Party Products
  • posted a message on MTG JSON - New website provides MTG card data in JSON format
    @cyclotis04 Basically, I did a bunch of database inserts using cardId as a primary key, and got duplcate primary key clashes.

    Unfortunately, SHA is a hash, not a UUID, so it can't guarantee uniqueness. The bigger the dataset, the bigger the chance of a duplicate.

    I've tried a couple of different solutions, but haven't managed to find one yet that passes my basic criteria (must be unique, must be able to be used in a URL / XML without requiring encoding, preferably fixed width, and able to be reproduced predictably from card data, or the same across multiple updates).

    The best solution I can come up with from the source data end would be if each card record in MTGJSON were assigned a UUID at initial creation time, but that updates to the file used the fields used to generate the cardId hash when identifying which record to update, so that the ID stays constant.

    Edit: It'd actually be handy if each entity described in a record had its own ID, now that I think about it - each record basically describes a single printing of a single playable (of which there can be more than one on a split, flip or double-faced card) on a card. Card, Printing and Playable can all be considered separate entities, potentially needing their own ids for linking purposes.
    Posted in: Third Party Products
  • posted a message on MTG JSON - New website provides MTG card data in JSON format
    Hi @Andarilhomtg Smile Thanks for taking on this responsibility Smile

    Small question about the cardId field, since I'm working on a new database structure for my site - I've noticed that the SHA1 hashes used for cardIds in MTGJSON aren't necessarily unique. Is it possible to refine the cardId field a bit going forward? Smile
    Posted in: Third Party Products
  • posted a message on MTG JSON - New website provides MTG card data in JSON format
    Quote from Sembiance »
    The hand over of MTGJSON is complete. Someone else is now running it and will be the one updating it in the future. So long, and thanks all Smile


    Thanks Sembiance - you've been amazing Smile
    Posted in: Third Party Products
  • posted a message on MTG JSON - New website provides MTG card data in JSON format
    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...
    Posted in: Third Party Products
  • posted a message on MTG Image - Provides high resolution card images
    Quote from aeos »
    MCI is currently broken - it displays a `403 forbidden` error when attempting to access an image


    Seems to have been fixed now Smile
    Posted in: Third Party Products
  • posted a message on MTG Image - Provides high resolution card images
    Thanks Nis - good to know Smile
    Posted in: Third Party Products
  • posted a message on MTG Image - Provides high resolution card images
    Quote from jilbot »
    I'm new to this forum so I hope this is the right place to post this. If not, pls redirect to correct place.

    Has anyone discovered alternative sources for downloading images? I'm creating a new app using mtgjson (what a great resource!) but it will be pretty useless if it can't display card images. Naturally I would like to be able to display any and all cards, old and new. I've been doing quite a bit of searching and this appears to be a big problem for lots of developers.

    It looks like it might be possible to get images directly from wizards.com, but I imagine it's not that simple. Plus, I'm not sure whether that's even permissible.

    Any update on this topic would be much appreciated!


    Up until fairly recently there was another API (mtgapi) that was serving up the images, but that's since been taken down.

    The T&Cs for Gatherer, unfortunately, prohibit scraping their site for images (their images are a bit low-res anyway)

    Some sites use MagicCards.info as an image source, although I'm not sure what MCI's own stance on this is (of any of their devs frequent these forums, I'd love to hear their position). They use a special set code (included in MTGJSON) and the number of the card in the set (with some exceptions - see this post for information on how to generate missing card numbers) to construct their URL... Some examining of their site should turn up the rest of the info you need Smile
    Posted in: Third Party Products
  • posted a message on MTG JSON - New website provides MTG card data in JSON format
    Thanks heaps, Sembiance! Grin

    Quote from tom__bombadil »
    It seems the 'foreignNames' are missing in Zendikar Expedition.


    Assuming this is because the Expedition cards are only printed in English, even though they can appear in international boosters Smile
    Posted in: Third Party Products
  • posted a message on Minouris's Library - Collection Manager and Deck Builder (Massive deck builder update!)
    Zendikar Expedition and Battle for Zendikar have been added Smile

    I'm doing some fiddling with the database at the moment, which is slowing up other development. Hopefully, by the time I'm finished, the data on the site will be easier to update, and will be able to support promos. Touch wood Smile
    Posted in: Third Party Products
  • posted a message on Shout out to the over 30 FNMers
    37, no kids yet. I started playing with my wife a couple of years ago, and she plays as part of my regular EDH group, as well as partnering me in 2HG when it pops up at FNM Smile
    Posted in: Magic General
  • To post a comment, please or register a new account.