Created
May 31, 2016 14:22
-
-
Save nsheridan/81e4fc30f38ad7daff126ccebe212a93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
require 'clipboard' | |
num_emoji = ARGV.count == 1 && ARGV[0].to_i || 3 | |
doc = Nokogiri::HTML(open('http://www.emoji-cheat-sheet.com/')) | |
emoji = doc.css('span.name').map(&:content) | |
emoji_str = emoji.sample(num_emoji).map {|em| ":#{em}:" }.join(' ') | |
Clipboard.copy(emoji_str) | |
puts "Copied to clipboard: #{emoji_str}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment