Giter Site home page Giter Site logo

slack-emojis's Introduction

slack-emojis

Setup

You'll need Python and pip to get started. I recommend using virtualenv and possibly virtualenvwrapper as well. Standard best-practice Python stuff.

Here's a way to install python 2.7 on a mac

# brew update || echo "could not update brew: $!"
which pyenv &> /dev/null
if [ $? -ne 0 ]; then
  brew install pyenv &&
  pyenv install 2.7 &&
  pyenv global 2.7 &&
  echo 'Add to your login rc: eval "$(pyenv init -)"' &&
  eval "$(pyenv init -)"
fi
which pyenv &> /dev/null
if [ $? -eq 0 ]; then echo 'pyenv installed'; else echo 'pyenv not installed'; fi

Install prerequisites

pyenv global 2.7
pip install -r requirements.txt

Before upload/download

  1. cp .env.example .env
  2. edit .env, follow comments to configure variables
  3. source .env

You'll need to edit the .env whenever switching teams.

Bulk download emoji from Slack

python get_emojis.py -o images "${SLACK_TEAM}" "${SLACK_TOKEN}"

Get the token from https://api.slack.com/web

Also see https://github.com/elight/slack_emoticon_inhaler and maybe https://github.com/github/gemoji/tree/master/images/emoji and https://github.com/jglovier/gifs and https://github.com/muan/emojilib/blob/master/emojis.json

Bulk upload emoji into Slack

Want to create a custom Slack emoji for every pokemon?

Slack doesn't currently expose an API endpoint for uploading emoji.

Add images to the images/ folder*. 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).

You'll need to have configured the .env with $SLACK_TEAM and $SLACK_COOKIE

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

source .env && python upload.py images/*

*: If using a different source folder, be sure to change the folder in the above command.

Or even try:

source .env && python upload.py $(git ls-files images/* | xargs)
# or to limit to the ones you just committed:
python upload.py $(git diff HEAD^..HEAD --stat | grep images | awk '{print $1 }' | xargs )

via https://github.com/smashwilson/slack-emojinator/

โœจ

slack-emojis's People

Contributors

bf4 avatar jacebrowning avatar jkloo avatar thommay avatar

Stargazers

Dave Schinkel avatar Seth Voltz avatar Elijah Wright avatar Sean Hussey avatar Matt Cable avatar Mikhail Kulishkin avatar Anton Galitsyn avatar  avatar

Watchers

 avatar James Cloos avatar

Forkers

thommay

slack-emojis's Issues

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.