Cockatrice: Integrate with awesome decklist printing service! (decklist.org)

Created on 30 Nov 2017  路  9Comments  路  Source: Cockatrice/Cockatrice

The page: https://decklist.org/
Easy integration possible: https://decklist.org/html/directlinking.html
Maybe similar to what we sent to deckstats.net.

We would display a form (with pre-saved values or even different profiles for personal details and allow to load a saved deck or import/paste one) with the needed (+optional) fields to generate the link from.

A request would look like this and is a simply extended HTML link:
Example with winning deck from GP Portland:
https://www.decklist.org/?firstname=Player-First&lastname=Player-Last&dcinumber=1234567890&eventdate=2017-11-17&event=Grand%20Prix%20Portland&eventlocation=Oregon%20Convention%20Center&deckmain=2%20Abrade%0A4%20Aether%20Hub%0A4%20Attune%20with%20Aether%0A4%20Botanical%20Sanctum%0A4%20Bristling%20Hydra%0A2%20Chandra,%20Torch%20of%20Defiance%0A1%20Commit%20//%20Memory%0A2%20Confiscation%20Coup%0A4%20Forest%0A3%20Glorybringer%0A4%20Harnessed%20Lightning%0A1%20Island%0A4%20Longtusk%20Cub%0A1%20Magma%20Spray%0A2%20Mountain%0A4%20Rogue%20Refiner%0A3%20Rootbound%20Crag%0A4%20Servant%20of%20the%20Conduit%0A1%20Sheltered%20Thicket%0A3%20Spirebluff%20Canal%0A3%20Whirler%20Virtuoso%0A1%20random%20card%20to%20trigger%20errors&deckside=2%20Abrade%0A1%20Aethersphere%20Harvester%0A1%20Chandra's%20Defeat%0A1%20Confiscation%20Coup%0A1%20Lifecrafter's%20Bestiary%0A1%20Magma%20Spray%0A2%20Negate%0A1%20Nissa,%20Steward%20of%20Elements%0A1%20Slice%20in%20Twain%0A1%20Supreme%20Will%0A1%20Torrential%20Gearhulk%0A5%20Vizier%20of%20Many%20Faces

I only replaced newlines with %0A and spaces with %20.
More html encoding might be needed in other circumstances.
List of them: https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding

So his sideboard

2 Abrade
1 Aethersphere Harvester
1 Chandra's Defeat
1 Confiscation Coup
1 Lifecrafter's Bestiary
1 Magma Spray
2 Negate
1 Nissa, Steward of Elements
1 Slice in Twain
1 Supreme Will
1 Torrential Gearhulk
2 Vizier of Many Faces

translated to
deckside=2%20Abrade%0A1%20Aethersphere%20Harvester%0A1%20Chandra's%20Defeat%0A1%20Confiscation%20Coup%0A1%20Lifecrafter's%20Bestiary%0A1%20Magma%20Spray%0A2%20Negate%0A1%20Nissa,%20Steward%20of%20Elements%0A1%20Slice%20in%20Twain%0A1%20Supreme%20Will%0A1%20Torrential%20Gearhulk%0A2%20Vizier%20of%20Many%20Faces
attached to the decklist.org url.

The hints and error the site provides are actually very useful, too! (check the lower box on the right)

I'm highly impressed by that site! It's code is on github, too: https://github.com/april/decklist
Awesome work @april! Thanks. :)

This might be a key feature for future versions. Even if the dialog ends up very simple in the first version. (no saved fields, no profiles...)
Not only can you brew, test and fine tune your deck, you also save a lot of time with creating a decklist and easily deal with last minute changes. All-in-one tournament preparation 2.0 made easy with Cockatrice. 馃憤

App - Cockatrice Good first issue Suggestion

Most helpful comment

An even simpler first implementation would be to just include the information about cards (main deck + sideboard).
This information is already available and there needs to be no dialog questioning personal details at all.

In that case the above link would be this:
https://www.decklist.org/?deckmain=2%20Abrade%0A4%20Aether%20Hub%0A4%20Attune%20with%20Aether%0A4%20Botanical%20Sanctum%0A4%20Bristling%20Hydra%0A2%20Chandra,%20Torch%20of%20Defiance%0A1%20Commit%20//%20Memory%0A2%20Confiscation%20Coup%0A4%20Forest%0A3%20Glorybringer%0A4%20Harnessed%20Lightning%0A1%20Island%0A4%20Longtusk%20Cub%0A1%20Magma%20Spray%0A2%20Mountain%0A4%20Rogue%20Refiner%0A3%20Rootbound%20Crag%0A4%20Servant%20of%20the%20Conduit%0A1%20Sheltered%20Thicket%0A3%20Spirebluff%20Canal%0A3%20Whirler%20Virtuoso%0A1%20random%20card%20to%20trigger%20errors&deckside=2%20Abrade%0A1%20Aethersphere%20Harvester%0A1%20Chandra%27s%20Defeat%0A1%20Confiscation%20Coup%0A1%20Lifecrafter%27s%20Bestiary%0A1%20Magma%20Spray%0A2%20Negate%0A1%20Nissa,%20Steward%20of%20Elements%0A1%20Slice%20in%20Twain%0A1%20Supreme%20Will%0A1%20Torrential%20Gearhulk%0A5%20Vizier%20of%20Many%20Faces

(for more clearness: https://www.decklist.org/?deckmain=[copies of card #1]%20[card name #1]%0A[copies of card #2]%20[card name #2]%0A[other cards...]&deckside=[copies of sideboard card #1]%20[sideboard card name #1]%0A[other cards...] )

All missing information (like name and DCI#) can then be added on the page directly!

All 9 comments

Would love to see this feature; I'm a big fan of the Decklist site. I've used it to print decklists for competitive-REL tournaments on multiple occasions, and contributed some code to it as well.

Thank you, please let me know if you run into any issues or have any feature requests for the direct linking.

This would be an easy change to add - the existing deckstats code should be a reasonable guideline for some to cargo cult from.

We do have a deck list feature built in you can use to print but I will admit it's not pretty :)

Any issues so far or discussions with judges/organizers on high-level tournaments? @Nightfirecat
No idea if non-handwritten is allowed or a special card ordering in your list is mandatory for example. :)

The deck list print feature is not great indeed.

I've never had any issues thus far. I've never known any tournament to require cards be ordered in a specific fashion (since players hand-writing their lists can and will write them down in whatever order they choose). Decklist has a selector for several ordering methods, with ordering by color as the default.

There's nothing wrong with handwritten lists, although I wouldn't be surprised to see that change someday. Judges really love players with digital lists, however.

I will add that color sort was what came out of polling a bunch of judges as to which order they would like best. It was pretty close between color and CMC, with every other option lagging badly.

An even simpler first implementation would be to just include the information about cards (main deck + sideboard).
This information is already available and there needs to be no dialog questioning personal details at all.

In that case the above link would be this:
https://www.decklist.org/?deckmain=2%20Abrade%0A4%20Aether%20Hub%0A4%20Attune%20with%20Aether%0A4%20Botanical%20Sanctum%0A4%20Bristling%20Hydra%0A2%20Chandra,%20Torch%20of%20Defiance%0A1%20Commit%20//%20Memory%0A2%20Confiscation%20Coup%0A4%20Forest%0A3%20Glorybringer%0A4%20Harnessed%20Lightning%0A1%20Island%0A4%20Longtusk%20Cub%0A1%20Magma%20Spray%0A2%20Mountain%0A4%20Rogue%20Refiner%0A3%20Rootbound%20Crag%0A4%20Servant%20of%20the%20Conduit%0A1%20Sheltered%20Thicket%0A3%20Spirebluff%20Canal%0A3%20Whirler%20Virtuoso%0A1%20random%20card%20to%20trigger%20errors&deckside=2%20Abrade%0A1%20Aethersphere%20Harvester%0A1%20Chandra%27s%20Defeat%0A1%20Confiscation%20Coup%0A1%20Lifecrafter%27s%20Bestiary%0A1%20Magma%20Spray%0A2%20Negate%0A1%20Nissa,%20Steward%20of%20Elements%0A1%20Slice%20in%20Twain%0A1%20Supreme%20Will%0A1%20Torrential%20Gearhulk%0A5%20Vizier%20of%20Many%20Faces

(for more clearness: https://www.decklist.org/?deckmain=[copies of card #1]%20[card name #1]%0A[copies of card #2]%20[card name #2]%0A[other cards...]&deckside=[copies of sideboard card #1]%20[sideboard card name #1]%0A[other cards...] )

All missing information (like name and DCI#) can then be added on the page directly!

I've got a preliminary solution working - would someone be so kind to point me in the right direction on forking/uploading guidelines for this project?

Edit: Also a link to what/how I should document stuff.

Second edit: Also, I have no idea if my implementation is the cleanest way of doing it. I did my best to look around to see how other people were doing similar things and duplicate, but I'm just putting the disclaimer on that I only started working with this code today :).

@april we included your service. I hope you like @jrobe's approach!

Was this page helpful?
0 / 5 - 0 ratings