[Bounty] - Discourse Plugin for Inserting Deck

The idea here is to add a button to the composer labeled “Insert Deck”. The user clicks this button and then has an input window where they can copy paste text inside a box. Then the user simply presses “ok” after inserting the text. Here is an example with the new button in composer toolbar:
After clicking the button:

The user input doesn’t matter. It’s just some base64 code which represents the contents of a deck of cards. You url encode that code and pass it through the api. For example, let’s use this code:


The raw code after being url encoded:

Then this is passed through the api with the imageify parameter if Image was selected via where code would be the above url encoded code like this:

You can open that above link in your browser and it should show an image. That image is basically what should be inserted into the post after pressing ok if Image was selected in the checkbox.

If List is also selected, then you can insert the list below the image. The url encoded code is again passed but this time through the convert parameter like this: where code again is the url encoded code. You will get this now:

If you put the above link in your browser, it will return a json response that looks like this:


"names": "3 Nibiru, the Primal Being\n2 Exodius the Ultimate Forbidden Lord\n2 The Winged Dragon of Ra - Sphere Mode\n3 Fire Hand\n3 Ice Hand\n3 Thunder Hand\n3 Ghostrick Jiangshi\n2 Nopenguin\n2 Ghostrick Yuki-onna\n3 Penguin Soldier\n2 Ghostrick Jackfrost\n3 Ghostrick Lantern\n3 Ghostrick Specter\n3 Recurring Nightmare\n3 Evenly Matched\n\n1 Ghostrick Angel of Mischief\n1 Ghostrick Alucard\n1 Ghostrick Socuteboss\n1 Mechquipped Angineer\n1 Number 49: Fortune Tune\n1 Super Quantal Mech Beast Grampulse\n1 Wind-Up Zenmaines\n1 Slacker Magician\n1 Ghostrick Dullahan\n1 Kikinagashi Fucho\n1 Daigusto Emeral\n1 Castel, the Skyblaster Musketeer\n1 Number 39: Utopia\n1 Number S39: Utopia the Lightning\n1 Number 35: Ravenous Tarantula\n\n\n1 Ghost Belle & Haunted Mansion\n1 Ghost Mourner & Moonlit Chill\n1 Ghost Ogre & Snow Rabbit\n1 Ghost Ogre & Snow Rabbit\n2 Ghost Reaper & Winter Cherries\n2 Ghost Sister & Spooky Dogwood\n1 Ghostrick Yuki-onna\n1 Ghostrick Jackfrost"

The \n here are line breaks. So in the composer it should just paste that list like so:

3 Nibiru, the Primal Being
2 Exodius the Ultimate Forbidden Lord

The “Paste YDK” is basically a button to copy paste the contents of a text file. YDK is simply a TXT. They click the button->they pick a text file from their explorer->the contents gets pasted in the window. Just another way of inserting the input instead of copy paste.

You don’t have to worry about the user input. Even if it’s invalid, the api will return invalid. The composer simply needs to paste whatever the api returns.

The challenge primarily here is learning how to receive user input from discourse and then pasting the output from the api. Documentation can be found here:

  1. https://www.sitepoint.com/community/t/a-simple-discourse-plugin/116302
  2. https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-1/30515

I’ll likely work on this myself in the upcoming month if no one else wants to. Contact me if interested and we can negotiate the bounty.