:octopus: a Simple gemoji Emoji Extractor (for non macOS users) https://github.com/HorlogeSkynet/SgEExt
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Samuel FORESTIER ea6a2ba8ff The license has changed, let's bump the version 2 weeks ago
.gitignore Makes git ignore copied / downloaded PNGs within the project directory 1 month ago
LICENSE Renames and changes LICENSE (as it appears to be a "real" project) 2 weeks ago
README.md Extends the REGEXP in the Jekyll example to match numbers, '-' and '_' 1 month ago
SgEExt.py The license has changed, let's bump the version 2 weeks ago

README.md

SgEExt — a Simple gemoji Emoji Extractor

Pronounced [sgɪksˈt]

Introduction

Let’s have a talk about an usual situation.
You run a self-hosted Jekyll blog, with the jemoji plugin loaded so as to “enhanced” your content with some emojis.
You’d have noticed that by default the plugin renders your static pages with <img> whose src attributes are pointing to a GitHub’s (Microsoft’s) location.
The latter means that a third-party is able (note that it may not be the case) to log people who consult your website, and thus is a privacy issue.

So, at this step, you may have tried to extract images to serve it yourself, but the operation is only possible from a macOS system (‘cause Apple emojis are present within the system font, and… gemoji is mainly using the “Apple’s emoji character palette”).

Now that is said, you have some options :

  • Buy an Apple device
  • Kindly ask a friend with an Apple device to extract and send you those PNGs (cc @Naernon)
  • Change your underneath emojis module / plugin / whatever
  • Wait for the gemoji project to use another set of emoji
  • Download PNGs directly from GitHub, and that is definitely what this is about !

Dependencies

  • python3
  • python3-requests

Installation

Manually

git clone https://github.com/HorlogeSkynet/SgEExt.git

Usage

python3 SgEExt.py --help

# Careful, running without any arguments would download the whole emojis palette (under `./emojis/`) !
python3 SgEExt.py

# This directory structure will be created if it does not exist.
python3 SgEExt.py -l joy -d emojis/images/

# Wanna force re-download of existing files ? Sure.
python3 SgEExt.py -l joy relaxed sunglasses -d emojis/images/ -f

# Wanna save "real" emojis under their "real" name ? Sure.
python3 SgEExt.py -l ok_hand -n 

# Wanna download GitHub added "emojis" (mostly images) ? Sure.
python3 SgEExt.py -l bow relaxed octocat trollface --verbose

# 'octocat' & 'trollface' would be ignored.
python3 SgEExt.py -l bow relaxed octocat trollface --only-emojis

# Wanna download the emojis currently being used in your (Jekyll) blog ? Sure.
python3 SgEExt.py -l $(grep -hREo ':[a-z1-9_-]+:' /path/to/your/blog/_posts/*.md | sort | uniq | cut -d ':' -f 2) -d /path/to/your/blog/images/emojis/

How does it work ?

The script… :

  • … (after having tried locally) fetches the emojis database hosted on GitHub (don’t click if you are on mobile)
  • … iterates through the elements and extracts their unicode value as hexadecimal
  • … uses the above result to download them from GitHub

As githubassets.com is actually a CDN, it does not look rate-limited.
Anyway, I cannot take any responsibility for any inappropriate usage of this software.

Compatibility

Although SgEExt has been developed with cross-platform constraints, it has not been tested on Windows yet.
Feedbacks are welcome, as usual.

Apple users, you don’t have to go this way.