Topic: Web API?

Hi,

I was thinking of trying to make something similar to Cockatrice and Magic Workstation but that's fully web-based. The idea is that you can play is in your browser and by that also on iPad and other tablets, anything with a browser really. This is just an idea, and might never be realised, but I do it for fun and if it works out it might become something cool.
Now, I love DeckBox and it would be cool that people can just make their decks here, and then use them in my app. So my question is, are there any api's from deckbox for this kind of thing? Also for getting the card pictures by their name and stuff?
I couldn't find anything, so I thought to ask to be sure. It's going to be fully html/javascript.

Also, if there isn't something like this from Deckbox, I'll be sad, but it won't stop me. So if you know anything else, that would also be welcome! (I'll be looking for something too while you read this, though any suggestion is welcome.)

Thanks a lot!
-Pablo

Last edited by Pablini (2012-08-30 14:54:37)

Re: Web API?

Hi Pablo,

We don't have an API yet but we'd like to make one in the future.

As for card images, you can already get them: http://deckbox.org/help/tooltips

Re: Web API?

sebi wrote:

Hi Pablo,

We don't have an API yet but we'd like to make one in the future.

As for card images, you can already get them: http://deckbox.org/help/tooltips

Thanks,

Though is there any way to get the image, description, manacost, ... of a card from javascript by it's name?

Re: Web API?

Sorry, I misread your post regarding the images. smile

The only thing you can easily fetch right now is a card's image, by using a url like this:

   http://deckbox.org/mtg/Ponder/tooltip

(Where you replace Ponder by any mtg card name).

Re: Web API?

sebi wrote:

Sorry, I misread your post regarding the images. smile

The only thing you can easily fetch right now is a card's image, by using a url like this:

   http://deckbox.org/mtg/Ponder/tooltip

(Where you replace Ponder by any mtg card name).

That works great thanks! Was using a similar way but for the gatherer stuff. Now I just have to find the manacost & power somewhere tongue
Thanks big_smile

Re: Web API?

I have one more question. I can get the images perfectly, and they show correctly too. Though I get a warning "Resource interpreted as Image but transferred with MIME type text/html".
As far as I could figure out, it's because the image isn't saved as an image, but as text (when you go to the image's url you also get text, and not an image). Though is there a way to tell the browser it's all OK, and he shouldn't be worried? tongue
Also, why is it saved as text? Is this by design, and if so, why?

Thanks big_smile

Re: Web API?

Yep, looks like the mime type is wrongly set on them. Should be fixed soon! Thanks for reporting.

Re: Web API?

sebi wrote:

Yep, looks like the mime type is wrongly set on them. Should be fixed soon! Thanks for reporting.

No problem! Though I just tried again, and it's still text. Maybe you forgot about it? If not, it's not really a problem, though just though to remind you ^^

Thanks!

Re: Web API?

I would also like to have an API to this information.  Here's to hoping this is in the works!!  smile

Re: Web API?

Hi,

I've been doing some more investigating (and someone on Stackoverflow helped me), and in my program the problem isn't that the mime type is wrong (though it still is) it's that the url for the image doesn't end on an image extension (jpg, png, ...)
Still, a proper API would be super awesome big_smile Any nearer to getting this? tongue

Thanks!

Re: Web API?

Hey,

I just noticed you updated it. I can now use "http://deckbox.org/mtg/Ponder/tooltip.jpg" and it works awesomely!
Thanks a lot for that!

Edit: It doesn't work anymore now sad
Edit2: It does work for some cards, just not all... Yesterday it worked for Ponder, now it doesn't. Though it does work for "Teroh's Faithful". (Those are the only two I tried.)

Last edited by Pablini (2013-01-24 13:51:12)