Slide 1

Slide 1 text

⭐ ⭐ ⭐ ⭐ ⭐ Twemoji 3.0 in the making & beyond SG50

Slide 2

Slide 2 text

Good Evening!

Slide 3

Slide 3 text

@JuanitoFatas Taiwan

Slide 4

Slide 4 text

#NBAFinals

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

deppbot

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Announcement!!!

Slide 9

Slide 9 text

I GOT PROMOTED

Slide 10

Slide 10 text

CEO + CTO

Slide 11

Slide 11 text

Chief moji Officer Chief Typo Officier

Slide 12

Slide 12 text

Chief moji Officer Chief Typo Officier

Slide 13

Slide 13 text

Twemoji 3.0.0

Slide 14

Slide 14 text

Twitter Emoji as seen in this presentation, and…

Slide 15

Slide 15 text

Free to use with proper attributions

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

twemoji.js twitter/ twemoji

Slide 18

Slide 18 text

Twemoji RubyGem jollygoodcode/ twemoji

Slide 19

Slide 19 text

Twemoji.parse( "RubySG Meetup :flag-sg:" ) RubySG Meetup

Slide 20

Slide 20 text

CODES = { ":mahjong:" => "1f004", ":black_joker:" => "1f0cf", … ":registered_sign:" => "ae", ":shibuya:" => "e50a", }

Slide 21

Slide 21 text

Twemoji.find_by_text(":heart_eyes:") Twemoji.find_by_code(":heart_eyes:") Twemoji.find_by_unicode("") Twemoji.render_unicode(":heart_eyes:") Twemoji.render_unicode("")

Slide 22

Slide 22 text

Where the Names :heart_eyes:

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

1. Compile List of Unicodes 2. Post to Slack 3. Get the HTML back 4. Parse the HTML to get names 5. Re-compile the MAP hash

Slide 25

Slide 25 text

1. Compile List of Unicodes

Slide 26

Slide 26 text

1. Compile List of Unicodes

Slide 27

Slide 27 text

1. Compile List of Unicodes

Slide 28

Slide 28 text

2.Post to Slack require "http" class Slack def self.post(text) payload = { channel: "#foo", # <--- channel you want to post text: text, username: "emoji-poster", icon_emoji: ":robot_face:", }.each { |_, v| v } HTTP.post("https://hooks.slack.com/services/a/bb/ccc", json: payload) end end IO.readlines("twemoji-js-v2-unicodes").each_with_index do |line, index| cleaned = line.chomp.gsub(?", "") Slack.post(cleaned); sleep 0.3 end

Slide 29

Slide 29 text

2.Post to Slack require "http" class Slack def self.post(text) payload = { channel: "#foo", # <--- channel you want to post text: text, username: "emoji-poster", icon_emoji: ":robot_face:", }.each { |_, v| v } HTTP.post("https://hooks.slack.com/services/a/bb/ccc", json: payload) end end IO.readlines("twemoji-js-v2-unicodes").each_with_index do |line, index| cleaned = line.chomp.gsub(?", "") Slack.post(cleaned); sleep 0.3 end

Slide 30

Slide 30 text

1. Compile List of Unicodes 2. Post to Slack 3.Get the HTML back 4. Parse the HTML to get names 5. Re-compile the MAP hash

Slide 31

Slide 31 text

3.Get the HTML back

Slide 32

Slide 32 text

1. Compile List of Unicodes 2. Post to Slack 3. Get the HTML back 4.Parse the HTML to get names 5. Re-compile the MAP hash

Slide 33

Slide 33 text

4.Parse the HTML to get names span.message_body span.emoji-outer.emoji-sizer.emoji-only span.emoji-inner title="snowboarder" :snowboarder: span.emoji-outer.emoji-sizer span.emoji-inner title="skin-tone-2" :skin-tone-2:

Slide 34

Slide 34 text

4.Parse the HTML to get names span.message_body span.emoji-outer.emoji-sizer.emoji-only span.emoji-inner title="dart" :dart:

Slide 35

Slide 35 text

4.Parse the HTML to get names span.message_body

Slide 36

Slide 36 text

4.Parse the HTML to get names class ExtractEmoji def initialize(html) @html = html end def call titles = html.scan %r(title="(?[^"]+)") emojis = html.scan %r(>(?:[^:]+:)) text = html.scan %r(span class="message_body">(?.+)) if titles.empty? && emojis.empty? # unicode Hash("unicode" => text.join) else Hash(titles.join(" ") => emojis.join) end end private attr_reader :html end

Slide 37

Slide 37 text

4.Parse the HTML to get names RSpec.describe ExtractEmoji do describe "#call" do def result ExtractEmoji.new(html).call end context "emoji with skin tone" do let(:html) do <<~HTML :snowboarder::skin-tone-6: HTML end it "returns" do expect(result).to eq Hash( "snowboarder skin-tone-6" => ":snowboarder::skin-tone-6:") end end context "emoji only" do let(:html) do <<~HTML :dart: HTML end it "returns" do expect(result).to eq Hash("dart" => ":dart:") end end context "unicode" do let(:html) do <<~HTML © HTML end it "returns" do expect(result).to eq Hash("unicode" => "©") end end end end

Slide 38

Slide 38 text

4.Parse the HTML to get names class AppendSkinTones def initialize(emoji_lists) @emoji_lists = emoji_lists end def call color_index = 2 emoji_lists.each_with_index do |current, index| if current == emoji_lists[index+1] title, emoji = current.to_a.flatten emoji_lists[index] = append_skin_tone(title, emoji, color_index) color_index += 1 else color_index = 2 end end end private attr_reader :emoji_lists def append_skin_tone(title, emoji, color_index) { "#{title} skin-tone-#{color_index}" => "#{emoji}:skin-tone-#{color_index}:" } end end

Slide 39

Slide 39 text

1. Compile List of Unicodes 2. Post to Slack 3. Get the HTML back 4. Parse the HTML to get names 5.Re-compile the MAP hash

Slide 40

Slide 40 text

5.Re-compile the MAP hash class TwemojiJS MAP = { ":mahjong:" => "1f004", ":black_joker:" => "1f0cf", ":a_negative:" => "1f170", ":b_negative:" => "1f171", ... ":copyright:" => "a9", ":registered_sign:" => "ae", ":shibuya:" => "e50a", } end

Slide 41

Slide 41 text

5.Re-compile the MAP hash class TwemojiJS MAP = { ":mahjong:" => "1f004", ":black_joker:" => "1f0cf", ":a_negative:" => "1f170", ":b_negative:" => "1f171", ... ":copyright:" => "a9", ":registered_sign:" => "ae", ":shibuya:" => "e50a", } end

Slide 42

Slide 42 text

Review and fixes some error

Slide 43

Slide 43 text

jollygoodcode/ emoji-keywords

Slide 44

Slide 44 text

Adapt existing codebase

Slide 45

Slide 45 text

Fix documentations

Slide 46

Slide 46 text

Add some specs

Slide 47

Slide 47 text

Update README.md

Slide 48

Slide 48 text

Update CHANGELOG.md

Slide 49

Slide 49 text

Full Changes https://github.com/jollygoodcode/twemoji/pull/22

Slide 50

Slide 50 text

Twemoji and Rails https://git.io/vozsy

Slide 51

Slide 51 text

Twemoji and Jekyll JuanitoFatas/jekyll-twemoji

Slide 52

Slide 52 text

Beyond SG50

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

Turbolinks

Slide 55

Slide 55 text

Singapore is a “Gem”

Slide 56

Slide 56 text

One of our Gems

Slide 57

Slide 57 text

So Unique

Slide 58

Slide 58 text

Mixed Culture

Slide 59

Slide 59 text

Such a Language

Slide 60

Slide 60 text

Behasa Melayu
 Chinese
 Tamil English

Slide 61

Slide 61 text

Wat we speak in Singapura

Slide 62

Slide 62 text

Singlish

Slide 63

Slide 63 text

ň'XGT[DQF[KPVJKUEQWPVT[UJQWNFNGCTPVQRTQITCOCEQORWVGT DGECWUGKVVGCEJGU[QWJQYVQVJKPMʼnŃ5VGXG,QDU

Slide 64

Slide 64 text

Coming to Ruby

Slide 65

Slide 65 text

LIVE DEMO

Slide 66

Slide 66 text

empty_hor?

Slide 67

Slide 67 text

downcase_lah!

Slide 68

Slide 68 text

Kernel#ord irb(main)> ord Now every time when you “exit” console, feels great hor?

Slide 69

Slide 69 text

Kernel#bobian raise an exception! ¯\_(ϑ)_/¯

Slide 70

Slide 70 text

JuanitoFatas/ singapore

Slide 71

Slide 71 text

Made in Singapore

Slide 72

Slide 72 text

In my Airbnb* * bed without breakfast

Slide 73

Slide 73 text

Production Ready

Slide 74

Slide 74 text

$ gem install singapore

Slide 75

Slide 75 text

Fetching: singapore-51.gem (100%) Successfully installed singapore-51 1 gem installed

Slide 76

Slide 76 text

SG50+1

Slide 77

Slide 77 text

Now the power is on your fingers

Slide 78

Slide 78 text

Make the world a better place

Slide 79

Slide 79 text

CAN

Slide 80

Slide 80 text

can still Enjoy the #REDDOTRUBYCONF If cannot, lah

Slide 81

Slide 81 text

Kam sia! Thank you! 弃弃