Skip to content

Instantly share code, notes, and snippets.

@cobyism
Last active December 25, 2022 03:48
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cobyism/3746484 to your computer and use it in GitHub Desktop.
Save cobyism/3746484 to your computer and use it in GitHub Desktop.
Generate a random emoji bomb via the command-line
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
# Run `emojibomb` to get three emoji.
# Run `emojibomb N`, where `N` is a positive integer to get N emoji.
response = open("http://www.emoji-cheat-sheet.com/")
html = response.read
emoji = html.scan(/:\S+:/)
count = [ARGV.first.to_i, 3].max
bomb = ""
count.times do
bomb << emoji.sample
end
puts bomb
@woto
Copy link

woto commented Dec 25, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment