Skip to content

Instantly share code, notes, and snippets.

@dennmart
Forked from hrp/emojibomb.rb
Last active August 29, 2015 13:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dennmart/8857690 to your computer and use it in GitHub Desktop.
Save dennmart/8857690 to your computer and use it in GitHub Desktop.
Gets a random emoji from http://www.emoji-cheat-sheet.com/ and copy it to the clipboard (Mac Only).
#!/usr/bin/env ruby
require 'open-uri'
require 'nokogiri'
doc = Nokogiri::HTML(open("http://www.emoji-cheat-sheet.com/"))
emoji = doc.css('.name')
IO.popen('pbcopy', 'w') { |f| f << ":#{emoji.to_a.sample.text}:" }
puts "Copied to clipboard!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment