Author Topic: WhatsApp emoji  (Read 24094 times)

0 Members and 1 Guest are viewing this topic.

Offline ThugTopic starter

  • Full Member
  • ***
  • Posts: 190
  • Country: 00
  • Karma: 7
  • Version Info
Re: WhatsApp smiles (need help)
« Reply #45 on: 16 07 2015, 12:57:28 »
This one works for most smileys, you are right.
Should work for 100% :) Please report if you find any issues.

There was an error during second part unzipping related to e521.png file, however seems it affects nothing.
This is multi-volume archive (I had to split it due to forum limitations). Such archives should be opened by placing all the parts to the same folder and using only the first part. The error occures while trying to unzip other parts separately, no need to do it...

Smileys from the wiki plugins page are not working
Ofcourse they aren't - I've told about it just before your fist post in this thread ???

watcher, please, update the smileypack on the server...
« Last Edit: 16 07 2015, 13:01:09 by Thug »
 

Offline dyrkin

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re:WhatsApp smiles (need help)
« Reply #46 on: 18 07 2015, 13:52:47 »
BTW, here is a full Emoji set grabbed from the official page. With tooltips :)
Feel free to use, share, or whatever you want..

Traditionally, here is the code used for files generation
Code: [Select]
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;
import org.jsoup.nodes.Document;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Element;

import java.io.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by bykov on 13.07.2015.
 */
public class EmojiProcessor {

    private static final String outDir = "data/out/";

    private static final Map<String, HashMap <String, String>> protocols = new HashMap<>();
    static {
        protocols.put("BW", new HashMap<String, String>());
        protocols.get("BW").put("name", "BW");
        protocols.get("BW").put("index", "3");
        protocols.put("Apple", new HashMap<String, String>());
        protocols.get("Apple").put("name", "Apple");
        protocols.get("Apple").put("index", "4");
        protocols.put("Andr", new HashMap<String, String>());
        protocols.get("Andr").put("name", "Andr");
        protocols.get("Andr").put("index", "5");
        protocols.put("Twit", new HashMap<String, String>());
        protocols.get("Twit").put("name", "Twit");
        protocols.get("Twit").put("index", "6");
        protocols.put("Wind", new HashMap<String, String>());
        protocols.get("Wind").put("name", "Wind");
        protocols.get("Wind").put("index", "7");
        protocols.put("GMail", new HashMap<String, String>());
        protocols.get("GMail").put("name", "GMail");
        protocols.get("GMail").put("index", "8");
        protocols.put("DCM", new HashMap<String, String>());
        protocols.get("DCM").put("name", "DCM");
        protocols.get("DCM").put("index", "9");
        protocols.put("KDDI", new HashMap<String, String>());
        protocols.get("KDDI").put("name", "KDDI");
        protocols.get("KDDI").put("index", "10");
        protocols.put("SB", new HashMap<String, String>());
        protocols.get("SB").put("name", "SB");
        protocols.get("SB").put("index", "11");
    }

    public static void main(String[] args) throws java.io.IOException{
        //Uncomment to use online version
        //Document doc = Jsoup.connect("http://unicode.org/emoji/charts/full-emoji-list.html").get();
        File input = new File("data/Full Emoji Data.html");
        Document doc = Jsoup.parse(input, "UTF-8");
        String rownumber;
        String character;
        String tooltip;

        // Clean files and prepare msl files
        for (HashMap protocol: protocols.values()) {
            FileUtils.deleteDirectory(new File(outDir + protocol.get("name").toString() + "/"));
            new File(outDir + protocol.get("name").toString()).mkdir();
            prepareMSLFiles(protocol.get("name").toString());
        }

        // Parse html file extract images and compile msl file
        for (Element table: doc.select("table")) {
            for (Element row : table.select("tr")) {
                // Ignore headers
                if ("Count".equals(row.child(0).text()))
                    continue;
                else {
                    rownumber = row.child(0).text();
                    character = row.child(1).child(0).attr("name");
                    tooltip = row.child(12).text();
                }
                // For each table record save image and add record to msl file
                for (HashMap protocol: protocols.values()) {
                    if (!row.child((Integer.parseInt(protocol.get("index").toString()))).children().isEmpty()) {
                        savePicture(protocol.get("name").toString(), getImageData(row, Integer.parseInt(protocol.get("index").toString())), rownumber);
                        addMSLRecord(protocol.get("name").toString(),getPNGName(rownumber),character, tooltip);
                    }
                }
            }
        }
    }

    // Decode Base64 data tag and save it as png file
    private static void savePicture(String protocol, String img, String name) throws java.io.IOException{
        byte[] data = Base64.decodeBase64(img);
        String filename = outDir + protocol + "/" + getPNGName(name);
        OutputStream stream = new FileOutputStream(filename);
        stream.write(data);
        stream.close();
    }

    // Remove 'data:image/png;base64,' from the beginning
    private static String getImageData(Element row, int index) {
        return row.child(index).child(0).attr("src").substring(22);
    }

    // Left pad 5 leading zeros to PNG filename
    private static String getPNGName(String name) {
        return String.format("%1$" + 5 + "s", name).replace(' ', '0') + ".png";
    }

    // Add record to msl file for specified picture file and character
    private static void addMSLRecord(String protocol, String pngname, String character, String tooltip) throws java.io.IOException{
        String filename = outDir + protocol + ".msl";
        Writer out = new OutputStreamWriter(new FileOutputStream(filename, true), "UTF-16LE");
        out.append("Smiley = \"")
                .append(protocol)
                .append("\\")
                .append(pngname)
                .append("\",0,\"")
                .append(returnUnicodeChars(character))
                .append("\",\"")
                .append(tooltip)
                .append("\"\r\n");
        out.close();
    }

    // Create msl file and add headers
    private static void prepareMSLFiles(String protocol) throws java.io.IOException{
        DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
        Date date = new Date();

        String filename = outDir + protocol + ".msl";
        OutputStreamWriter stream = new OutputStreamWriter(new FileOutputStream(filename), "UTF-16LE");
        BufferedWriter out = new BufferedWriter(stream);
        // BOM
        out.write("\ufeff");
        // Header
        out.write("Name = \"" + protocol + " Emoji set\""); out.newLine();
        out.write("Author = \"Pavel Bykov\""); out.newLine();
        out.write("Date = \"" + dateFormat.format(date) + "\""); out.newLine();
        out.write("Version = \"1.0\""); out.newLine();
        out.write("SelectionSize = 24, 24"); out.newLine();
        out.write("WindowSize = 10, 8"); out.newLine();
        out.newLine();
        out.close();
    }

    private static String returnUnicodeChars(String character) {
        String[] chars;
        String returnchar = "";
        chars = character.split("_");
        for (int i=0; i<chars.length; i++) {
            returnchar+=String.valueOf(Character.toChars(Integer.parseInt(chars[i],16)));
        }
        return returnchar;
    }
}

Thank you
 

Offline ThugTopic starter

  • Full Member
  • ***
  • Posts: 190
  • Country: 00
  • Karma: 7
  • Version Info
Re: WhatsApp smiles (need help)
« Reply #47 on: 05 10 2015, 15:08:19 »
Hi. First of all, thanks a lot to MikalaiR for implementing horizontal sorting in SmileyAdd plugin, looks much better now :THUMBS UP:

And now, behold a new version (1.3) of whatsapp smilepack! Here are the changes:
 - multicultural emoji are added, including new emoji "Spock" and "Middle Finger". These new emoji are united in 59 six-icon pictures in android client sources, so, due to the lack of plugin functionality, I had to just split them in graphics redactor.
 - updated the flags (new Pakistan and Bangladesh flags were added, the rest were redisigned).

DOWNLOAD (see the attachment if the link doesn't work)

Gays and lesbians emoji are coming soon ;D

There are 1191 emoji in the pack now, and looks like will be much more in the future. As you can see, it's getting pretty hard to navigate through it. New functions such as tabs and that selection window for multicultural emoji are needed.

Btw, I have noticed that some odd symbol comes from iPhones with a group of emoji. The symbol is "FE0F" in hexademical code. And the emoji are, for example, horoscope signs, a snowflake, and many others. I wonder what is the purpose of it :-\
« Last Edit: 09 12 2016, 15:28:11 by Thug »
 

Offline watcher

  • Miranda NG support
  • Hero Member
  • *****
  • Posts: 1907
  • Country: il
  • Karma: 157
  • Version Info
Re: WhatsApp smiles (need help)
« Reply #48 on: 05 10 2015, 17:02:48 »
Thug,  can't download the pack for updating on server :( "Page not found" error.
Пожалуйста, внимательно прочтите правила постинга перед тем, как открыть новую тему.
Please read forum rules.
 

Offline ThugTopic starter

  • Full Member
  • ***
  • Posts: 190
  • Country: 00
  • Karma: 7
  • Version Info
Re: WhatsApp smiles (need help)
« Reply #49 on: 05 10 2015, 21:22:44 »
Thug,  can't download the pack for updating on server  "Page not found" error.
Sorry, made an attachment. Thought of using VK as a file hosting and failed ;D Thanks!
« Last Edit: 05 10 2015, 22:03:17 by Thug »
 

Offline watcher

  • Miranda NG support
  • Hero Member
  • *****
  • Posts: 1907
  • Country: il
  • Karma: 157
  • Version Info
Re: WhatsApp smiles (need help)
« Reply #50 on: 05 10 2015, 21:32:45 »
The pack has been updated.
Пожалуйста, внимательно прочтите правила постинга перед тем, как открыть новую тему.
Please read forum rules.
 

Offline ThugTopic starter

  • Full Member
  • ***
  • Posts: 190
  • Country: 00
  • Karma: 7
  • Version Info
Re: WhatsApp emoji
« Reply #51 on: 08 12 2016, 11:59:11 »
Hi. I had stopped updating this pack almost a year ago - when whatsapp plugin became completely unusable. But I was researching the web version of whatsapp recently and found all the source data requiered to build a new version of the smileypack, so I decided to undertake it again :)

The new version contains all currently supported 1770 emoji (+1 strange icon without a code) extracted from the web version as well as two discontinued emoji (Shibuya and Olympic Rings - they still work in some old clients). Now they are available in two resolutions: 40x40 and 64x64.

I have hidden all the multicultural (different skin color) emoji and the ones located in the last section ("Other") to make the selection menu look nicer and in order to match the official presentation. Feel free to unhide them by removing "*" symbol in "Smiley*" at the beginning of the strings.
* Thanks to Wishmaster for the tip!

The msl is saved in a simple UTF-8 format.
Dunno why did we use UTF-16 LE ???

I could also make an online version (just an .msl with direct links to the icons on whatsapp server), but does anyone really need it? Note that whatsapp developers regulary change everything and the links can turn broken anytime. Anyway, if you are interested, the links look like this:
https://web.whatsapp.com/img/c9c24f56.png

Download WhatsApp emoji pack v. 2.0

Hope it will inspire someone to continue developing whatsapp plugin or at least will come in handy for something :THUMBS UP:
Btw, it is 90% compatible with VK protocol now.
« Last Edit: 11 12 2016, 14:41:25 by Thug »
 

Offline ThugTopic starter

  • Full Member
  • ***
  • Posts: 190
  • Country: 00
  • Karma: 7
  • Version Info
Re: WhatsApp emoji
« Reply #52 on: 22 02 2017, 10:54:10 »
Catching up with WhatsApp implementing iOS 10.2 emojis (added support for Unicode 9 emojis, as well as new professions and a graphical redesign).

Download WhatsApp emoji pack v. 2.1
 

Offline dartraiden

  • Administrator
  • *****
  • Posts: 142
  • Country: ru
  • Karma: 8
  • Jabber ID
  • Version Info
Re: WhatsApp emoji
« Reply #53 on: 29 11 2017, 12:39:49 »
WhatsApp plugin is deprecated.
_██_
(°ᴗƪ)