Topic: Deckbox to OCTGN deck exporter

I posted in the deck building forum about this, but wanted to spread the word a little...

http://deckbox.org/forum/viewtopic.php?pid=46433

Re: Deckbox to OCTGN deck exporter

I have updated this program to accommodate recent changes to deckbox.org.

Sebi, I know you're probably tired of hearing this, but a simple API to request data would be great! Returning deck lists and card lists as JSON seems like it would be just as easy (if not easier) than building the HTML for the web page.

Thanks for the site, I think it's a very valuable resource to the Magic community.

Todd

Re: Deckbox to OCTGN deck exporter

Cool @ update!

Yep, API is on the list for a long time now. The problem is not outputting some json. The problem is the data format should not be changed too much once it is public, and needs to be properly documented, and solid.

We're going through a bunch of changes now, with the market, and another couple of enchancements and fixes that we'll announce soon. All these are slightly modifying our data structure (along with all the pricing changes that have been done lately).

I did not want the maintenance and cognitive burden of a stable public API to be in the way just yet, until I am confortable that all is solid in the backend.

Thank you for the patience.

Re: Deckbox to OCTGN deck exporter

I have posted 1.05 of this app:
Fixed issue with exporting cards that start with the combined "AE" symbol, such as "AEtherize" ("Aetherize").

Re: Deckbox to OCTGN deck exporter

Ugh, I just noticed yesterday that this exporter was broke again due to site changes. And I'm not quite sure how to handle these latest changes.

I found some handy-looking JSON in the source code (passed in as the contructor for new Tcg.Deck), which seems to include card info for the current deck, but it's not 100% correct when it comes to the sideboard. If you have the same card in both the main deck and the sideboard, it doesn't show up in the sideboard at all in this data.

Sebi, please advise.

[Edit] Actually I noticed that sometimes the cards are in the sideboard, sometimes in the main deck, but never in both like they should be (if the same card is in both).

Last edited by Gillissie (2014-06-25 20:30:29)

Re: Deckbox to OCTGN deck exporter

I have posted 1.06 of this app:
Changed to parse the JSON found in the source HTML, instead of the HTML itself. This may prove to be more reliable, and is a step in the direction of using a real API.

Known issue:
The JSON generated by deckbox.org appears to have a bug where if a card is in both the main deck and the sideboard, it will only show up in one or the other, not both.

Re: Deckbox to OCTGN deck exporter

Yep, you are correct. I use that json data only to fetch information about cards based on their ids, so they did not need to be 2 times in there (one for sideboard, one for main).

I will try to hurry up a bit with the API, even if it's an alpha version.

Re: Deckbox to OCTGN deck exporter

Hi Sebi. Has there been any progress on the API? I noticed that my exporter is broke again because of changes to the JSON in the HTML. (specifically, the "count" value is null for everything)

Oh, I did notice the deck export feature, which exports as CSV. That would be useful for my exporter to use if I could request an exported CSV file directly. I'm looking into what URL you're using to request it, but any help here would be appreciated.

(edit) I found the URL: http://deckbox.org/sets/export/[deck id]?format=csv&s=&o=&columns=

As long as this csv format doesn't change, this should work great until a real API is finished.

Last edited by Gillissie (2015-01-01 22:05:23)

Re: Deckbox to OCTGN deck exporter

Version 1.07 has been released to fix problems associated with Deckbox changes.

Re: Deckbox to OCTGN deck exporter

Version 1.08 has been released to fix problems associated with Deckbox changes.