Created
January 17, 2016 17:14
-
-
Save nicolasmlv/2d79473bd93e1ec56f34 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
## Hints for using emojione set with gemoji : | |
# replace images folder (images/emojione/unicode with https://github.com/Ranks/emojione/tree/master/assets/png) | |
# remove db/emojione.json | |
# bundle console -> | |
require 'JSON' | |
require 'open-uri' | |
emojione_json_url = "https://raw.githubusercontent.com/Ranks/emojione/master/emoji.json" | |
json_result = JSON.load(open(emojione_json_url)).map do |key, dict| | |
{ | |
"emoji" => dict["unicode"].split('-').map { |code| [code.to_i(16)].pack('U') }.join(''), | |
"description" => dict["name"], | |
"aliases" => [ key ], | |
"tags" => dict["keywords"] | |
} | |
end | |
File.open("db/emojione.json","w") do |f| | |
f.write(json_result.to_json) | |
end | |
# I am able to use https://github.com/github/gemoji/pull/85/ to emojify unicodeđź’© to <img> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment