GithubHelp home page GithubHelp logo

ideabrian / slack-emojinator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from smashwilson/slack-emojinator

0.0 1.0 0.0 29 KB

Bulk upload emoji into Slack

License: MIT License

Python 100.00%

slack-emojinator's Introduction

Slack Emojinator

Bulk upload emoji into Slack

Want to create a custom Slack emoji for every pokemon? Slack doesn't currently expose an API endpoint for creating emoji, probably to prevent users from doing exactly what I'm doing, but here's a way to do it anyway.

Creating Emoji

You'll need Python and pip to get started. I recommend using pipenv.

Prepare a directory that contains an image for each emoji you want to create. Remember to respect Slack's specifications for valid emoji images: no greater than 128px in width or height, no greater than 64K in image size. The base filename of each image file should be the name of the emoji (the bit you'll type inside : to display it).

Clone the project and install its prereqs:

libxml is required on your system, if you'd like to use the bulk export script.

git clone https://github.com/smashwilson/slack-emojinator.git
cd slack-emojinator
pipenv install

You'll need to provide your team name (the bit before ".slack.com" in your admin URL) and your session cookie (grab it from your browser). Copy .env.example, fill them in, and source it.

To grab your Slack session cookie:

  • Open your browser's dev tools and copy the value of document.cookie.
  • Go to the Network tab.
  • Re-load your workspace's https://{teamname}.slack.com/customize/emoji page.
  • Find the call to emoji (it is most likely the very top request).
  • Scroll to Request-Headers, copy the value of "Cookie," and add to your .env file.
cp .env.example .env
${EDITOR} .env
source .env

Now you're ready to go. Use a shell glob to invoke upload.py with the emoji files as ARGV:

pipenv run python upload.py ${EMOJI_DIR}/*.png

โœจ

Exporting Emoji

To export emoji, use export.py and specify an emoji directory:

source .env
pipenv run python export.py path-to-destination/

slack-emojinator's People

Contributors

smashwilson avatar d-lord avatar stavxyz avatar kvarga avatar matsu-chara avatar abn avatar zhilins avatar vmarkovtsev avatar

Watchers

Brian Ball avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.