add missing flags emoji
|
@ -4143,6 +4143,46 @@
|
|||
{
|
||||
"code": "1f5e8",
|
||||
"name": "left_speech_bubble"
|
||||
},
|
||||
{
|
||||
"code": "1f1e8-1f1f3",
|
||||
"name": "cn"
|
||||
},
|
||||
{
|
||||
"code": "1f1eb-1f1f7",
|
||||
"name": "fr"
|
||||
},
|
||||
{
|
||||
"code": "1f1e9-1f1ea",
|
||||
"name": "de"
|
||||
},
|
||||
{
|
||||
"code": "1f1ee-1f1f9",
|
||||
"name": "it"
|
||||
},
|
||||
{
|
||||
"code": "1f1ef-1f1f5",
|
||||
"name": "jp"
|
||||
},
|
||||
{
|
||||
"code": "1f1f7-1f1fa",
|
||||
"name": "ru"
|
||||
},
|
||||
{
|
||||
"code": "1f1f0-1f1f7",
|
||||
"name": "kr"
|
||||
},
|
||||
{
|
||||
"code": "1f1ea-1f1f8",
|
||||
"name": "es"
|
||||
},
|
||||
{
|
||||
"code": "1f1ec-1f1e7",
|
||||
"name": "gb"
|
||||
},
|
||||
{
|
||||
"code": "1f1fa-1f1f8",
|
||||
"name": "us"
|
||||
}
|
||||
],
|
||||
"aliases": {
|
||||
|
@ -4248,35 +4288,35 @@
|
|||
"flag_black": [
|
||||
"waving_black_flag"
|
||||
],
|
||||
"flag_cn": [
|
||||
"cn"
|
||||
"cn": [
|
||||
"flag_cn"
|
||||
],
|
||||
"flag_de": [
|
||||
"de"
|
||||
"de": [
|
||||
"flag_de"
|
||||
],
|
||||
"flag_es": [
|
||||
"es"
|
||||
"es": [
|
||||
"flag_es"
|
||||
],
|
||||
"flag_fr": [
|
||||
"fr"
|
||||
"fr": [
|
||||
"flag_fr"
|
||||
],
|
||||
"flag_gb": [
|
||||
"gb"
|
||||
"gb": [
|
||||
"flag_gb"
|
||||
],
|
||||
"flag_it": [
|
||||
"it"
|
||||
"it": [
|
||||
"flag_it"
|
||||
],
|
||||
"flag_jp": [
|
||||
"jp"
|
||||
"jp": [
|
||||
"flag_jp"
|
||||
],
|
||||
"flag_kr": [
|
||||
"kr"
|
||||
"kr": [
|
||||
"flag_kr"
|
||||
],
|
||||
"flag_ru": [
|
||||
"ru"
|
||||
"ru": [
|
||||
"flag_ru"
|
||||
],
|
||||
"flag_us": [
|
||||
"us"
|
||||
"us": [
|
||||
"flag_us"
|
||||
],
|
||||
"flag_white": [
|
||||
"waving_white_flag"
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
EMOJI_LIST_URL = "http://unicode.org/emoji/charts/full-emoji-list.html"
|
||||
EMOJI_KEYWORDS_URL = "https://raw.githubusercontent.com/muan/emojilib/master/emojis.json"
|
||||
|
||||
# until MS release the emoji flags, we'll use custom made flags
|
||||
WINDOWS_FLAGS = Set.new ["1f1e8_1f1f3", "1f1e9_1f1ea", "1f1ea_1f1f8", "1f1eb_1f1f7", "1f1ec_1f1e7", "1f1ee_1f1f9", "1f1ef_1f1f5", "1f1f0_1f1f7", "1f1f7_1f1fa", "1f1fa_1f1f8"]
|
||||
|
||||
desc "update emoji images"
|
||||
task "emoji:update" => :environment do
|
||||
emojis = {}
|
||||
|
@ -18,9 +21,10 @@ task "emoji:update" => :environment do
|
|||
next unless char = keywords[k]["char"].presence
|
||||
|
||||
code = char.codepoints
|
||||
.map { |c| c.to_s(16).rjust(4, "0") }
|
||||
.join("_")
|
||||
.gsub(/_fe0f$/i, "")
|
||||
.map { |c| c.to_s(16).rjust(4, "0") }
|
||||
.join("_")
|
||||
.downcase
|
||||
.gsub(/_fe0f$/, "")
|
||||
|
||||
emojis[code] ||= { name: k }
|
||||
end
|
||||
|
@ -42,7 +46,12 @@ task "emoji:update" => :environment do
|
|||
google = cell_to_image(cells[5])
|
||||
twitter = cell_to_image(cells[6])
|
||||
one = cell_to_image(cells[7])
|
||||
windows = cell_to_image(cells[9])
|
||||
|
||||
if WINDOWS_FLAGS.include?(code)
|
||||
windows = custom_windows_flag(code)
|
||||
else
|
||||
windows = cell_to_image(cells[9])
|
||||
end
|
||||
|
||||
if apple.blank? || google.blank? || twitter.blank? || one.blank? || windows.blank?
|
||||
emojis.delete(code)
|
||||
|
@ -79,6 +88,11 @@ def cell_to_image(cell)
|
|||
Base64.decode64(img["src"][/base64,(.+)$/, 1])
|
||||
end
|
||||
|
||||
def custom_windows_flag(code)
|
||||
name = code.upcase.tr("_", "-")
|
||||
open("https://github.com/discourse/discourse-emoji-extractor/raw/master/win10/72x72/windows_#{name}.png").read
|
||||
end
|
||||
|
||||
def write_emojis(emojis, aliases, style, folder)
|
||||
path = "public/images/emoji/#{folder}/"
|
||||
|
||||
|
|
After Width: | Height: | Size: 960 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 960 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 925 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 908 B |
After Width: | Height: | Size: 935 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 925 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 908 B |
After Width: | Height: | Size: 935 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 640 B |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 980 B |
After Width: | Height: | Size: 640 B |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 980 B |
After Width: | Height: | Size: 843 B |
After Width: | Height: | Size: 7.1 KiB |
After Width: | Height: | Size: 826 B |
After Width: | Height: | Size: 956 B |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 851 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 843 B |
After Width: | Height: | Size: 7.1 KiB |
After Width: | Height: | Size: 826 B |
After Width: | Height: | Size: 956 B |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 851 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 384 B |
After Width: | Height: | Size: 257 B |
After Width: | Height: | Size: 332 B |
After Width: | Height: | Size: 384 B |
After Width: | Height: | Size: 257 B |
After Width: | Height: | Size: 332 B |
After Width: | Height: | Size: 247 B |
After Width: | Height: | Size: 667 B |
After Width: | Height: | Size: 224 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 751 B |
After Width: | Height: | Size: 229 B |
After Width: | Height: | Size: 357 B |
After Width: | Height: | Size: 247 B |
After Width: | Height: | Size: 667 B |
After Width: | Height: | Size: 224 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 751 B |
After Width: | Height: | Size: 229 B |
After Width: | Height: | Size: 357 B |
After Width: | Height: | Size: 439 B |
After Width: | Height: | Size: 147 B |
After Width: | Height: | Size: 366 B |
After Width: | Height: | Size: 439 B |
After Width: | Height: | Size: 147 B |
After Width: | Height: | Size: 366 B |
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 698 B |
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 415 B |
After Width: | Height: | Size: 796 B |
After Width: | Height: | Size: 147 B |
After Width: | Height: | Size: 247 B |
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 698 B |
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 415 B |
After Width: | Height: | Size: 796 B |