Skip to content

Instantly share code, notes, and snippets.

@hrp
Forked from cobyism/emojibomb.rb
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hrp/8700700 to your computer and use it in GitHub Desktop.
Save hrp/8700700 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
require 'nokogiri'
# Run `emojibomb` to get three emoji.
# Run `emojibomb N`, where `N` is a positive integer to get N emoji.
doc = Nokogiri::HTML(open("http://www.emoji-cheat-sheet.com/"))
emoji = doc.css('.name')
count = [ARGV.first.to_i, 3].max
puts count
bomb = ""
count.times do
puts emoji.to_a.sample.text
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment