# Discourse Retort

**URL:** <https://meta.discourse.org/t/discourse-retort/35903>\
**Category:** Plugin\
**Tags:** end-of-life\
**Created:** [November 22, 2015, 11:53am UTC](https://meta.discourse.org/t/discourse-retort/35903 "2015-11-22T11:53:58Z")\
**Posts on this page:** 1\
**Showing post:** 466

<div class="post-metadata">

**Author:** ![mcdanlj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcdanlj/32/131829_2.png) [@mcdanlj](https://meta.discourse.org/u/mcdanlj)\
**Post date:** [August 18, 2022, 12:04am UTC](https://meta.discourse.org/t/discourse-retort/35903/466 "2022-08-18T00:04:21Z")

</div>

Here’s how to get a `|`-separated string for the retorts you currently have in use:

```shell
# ./launcher enter app
# rails c

```

```ruby
retorts = {}
PostDetail.where(extra: 'retort').each do |p|
  retort = p.key.split('|').first
  (retorts[retort] ||= []) << p
end
retorts.length
retorts.keys.join('|')

```

That gives you:

- First the number of unique retort emoji used
- Then the retorts in a form you could paste into Reaction configuration, perhaps after trimming if it’s too long to work for the Reactions UI.

For me, I get this string:

```plaintext
tada|rage|money_with_wings|face_vomiting|crossed_fingers|grin|vulcan_salute|worried|slightly_smiling_face|dart|+1|relaxed|star_struck|upside_down_face|sweat_drops|astonished|frowning_face|champagne|heavy_plus_sign|bulb|joy|fireworks|zap|smile|fast_forward|grinning|clap|sandwich|heart_eyes|rofl|smiley|wave|ice_cream|sob|mortar_board|open_mouth|pray|grimacing|roll_eyes|arrow_right_hook|brain|wink|cry|nerd_face|slight_smile|confused|ok|thinking|it|heart|smirk|sleepy|eyes|disappointed|question|laughing|man_shrugging|drum|shushing_face|herb|man_facepalming|ear|scream|ok_hand|mantelpiece_clock|smiling_face_with_three_hearts|confetti_ball|sunglasses|nose|pirate_flag|neutral_face|sweat_smile|gift|pensive|dark_sunglasses|exclamation|call_me_hand|green_heart|face_with_monocle|blush|boom|hugs|stuck_out_tongue|zipper_mouth_face|slightly_frowning_face|face_with_raised_eyebrow|exploding_head|information_source|sailboat|fire|gun|carousel_horse|sparkles|hearts|pizza|frowning|drooling_face|-1|100|metal|partying_face|four_leaf_clover|grinning_face_with_smiling_eyes|scream_cat|person_shrugging|deciduous_tree|sunflower|see_no_evil|hear_no_evil|speak_no_evil|微笑|top|face_with_peeking_eye|face_with_hand_over_mouth|stethoscope|money_mouth_face"

```

If you’d like to copy a list of existing retorts into a post in discourse to discuss what to keep when migrating to Reactions, you might instead use this:

```ruby
":" + retorts.keys.join(': :') + ':'

```

For me, that’s currently this set:

“🎉 😡 💸 🤮 🤞 😁 🖖 😟 🙂 🎯 👍 😌 🤩 🙃 💦 😲 ☹ 🍾 ➕ 💡 😂 🎆 ⚡ 😄 ⏩ 😀 👏 🥪 😍 🤣 😃 👋 🍨 😭 🎓 😮 🙏 😬 🙄 ↪ 🧠 😉 😢 🤓 🙂 😕 🆗 🤔 🇮🇹 ❤ 😏 😪 👀 😞 ❓ 😆 🤷‍♂️ 🥁 🤫 🌿 🤦‍♂️ 👂 😱 👌 🕰 🥰 🎊 🕶 👃 🏴‍☠️ 😐 😅 🎁 😔 🕶 ❗ 🤙 💚 🧐 😊 💥 🤗 😛 🤐 🙁 🤨 🤯 ℹ ⛵ 🔥 🔫 🎠 ✨ ♥ 🍕 ☹ 🤤 👎 💯 🤘 🥳 🍀 😄 🙀 🤷 🌳 🌻 🙈 🙉 🙊 :微笑: 🔝 🫣 🤭 🩺 🤑”

To get a bullet list of emojis with the number of instances of each:

```ruby
retorts.keys.sort.each do |k|
  puts "* :#{k}: #{retorts[k].length}"
end

```

I won’t paste the whole bullet list of emoji, but it starts like this:

- 👍 161
- 👎 1
- 💯 1
- ↪ 1
- 😲 9
- 😊 2
- 💥 2
- 🧠 23
- 💡 3

If you want to see every post that exists for each emoji:

```ruby
retorts.keys.sort.each do |k|
  puts "* :#{k}: #{retorts[k].length}"
  retorts[k].each do |r|
    p = Post.find_by(id: r.post_id)
    next if p.nil?
    puts " * #{p.full_url}"
  end
end

```

That’s way too long to paste here!

What I don’t know is how to _migrate_ all — or some of — those retorts to reactions. There is no mention of retort in the reactions plugin so it doesn’t do it automatically. I have 927 reactions with 116 unique emoji that I’d like to migrate to reactions.

I expect that I’ll be faced with dealing this at some point, preferably before Retort just quits working; if I implement the migration I’ll plan to document it here. But at least knowing what you have might help you.

---

_[View the full topic](https://meta.discourse.org/t/discourse-retort/35903)._
