The Tragic Story of u/AnEmojipastaBot

u/AnEmojipastaBot was a Reddit bot inspired by r/emojipasta. The idea was simple: turn the comments of other users into emojipasta, on request. An example:

An example of u/AnEmojipastaBot in action

The bot was a surprise hit, spreading across the entire website and acquiring 30k karma (or "upvotes") in a couple of days and keeping me busy with bug fixes. Eventually, it made too many enemies and its account was banned permanently by the admins of Reddit, supposedly for being spammy and annoying.

It was fun while it lasted, though, and rather than let the code (which generates rather good emojipasta) go to waste, I recently resurrected it as a web app.

In the rest of the post I'll give an overview of how the emojipasta generator works, some of the bot's greatest hits from Reddit, and mention some of the bugs I encountered during the few days that it was live.

How It Works

I wrote a script to download a few thousand comments off r/emojipasta, keeping track of which words appeared beside which emojis. The bot broke up comments into chunks of text and emojis were inserted randomly between the chunks using the word->emoji "mappings" from r/emojipasta, with a maximum of 2 emojis after each chunk. Only the alphanumeric prefix of each chunk of text was considered, so that "I'll" would give the same emoji mappings as "I".

That's about it. The code was pretty simple. The original source code of the bot, in Python, can be found HERE. The JavaScript version that I ported recently can be found HERE.

Hall of Fame

The bot's top comments during its brief lifespan.

Bug Trivia

I had to fix quite a few bugs in the bot's code as it picked up momentum on Reddit. It might be useful for future aspiring bot creators to be aware of them. Here is a possibly-non-comprehensive list:

The End

EmojipastaBot can now be laid to rest. Goodnight, sweet prince ⚰️

Post Date: 2019-09-29

Back to blog

Previous article: Simulating plane designs for faster boarding

Next article: Solving all 42 versions of the Harry Potter potions puzzle