Customizing Miranda NG (Addons) > Emoticons (Smileys)

WhatsApp emojipack (+Apple/Telegram)

<< < (10/12) > >>

Thug:

--- Quote from: dyrkin on 16 07 2015, 12:29:10 ---This one works for most smileys, you are right.
--- End quote ---
Should work for 100% :) Please report if you find any issues.


--- Quote from: dyrkin on 16 07 2015, 12:29:10 ---There was an error during second part unzipping related to e521.png file, however seems it affects nothing.
--- End quote ---
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...


--- Quote from: dyrkin on 16 07 2015, 12:29:10 ---Smileys from the wiki plugins page are not working
--- End quote ---
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...

dyrkin:
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: ---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;
    }
}

--- End code ---

Thank you

Thug:
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 redesigned).

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 :-\

watcher:
Thug,  can't download the pack for updating on server :( "Page not found" error.

Thug:

--- Quote from: watcher on 05 10 2015, 17:02:48 ---Thug,  can't download the pack for updating on server  "Page not found" error.
--- End quote ---
Sorry, made an attachment. Thought of using VK as a file hosting and failed ;D Thanks!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version