LoginSignup
2
2

More than 5 years have passed since last update.

Slack emojinator使ってみた

Last updated at Posted at 2017-02-16

TL;DR

slackへのemoji登録を自動化する話。

Slack emojinatorのインストール

https://github.com/smashwilson/slack-emojinator
ここに書いてある通り。

git clone https://github.com/smashwilson/slack-emojinator.git
cd slack-emojinator
pip install -r requirements.txt

複数個のemojiを登録するための準備

emoji_irai.png

ちょうどこんな依頼も来たので試してみた。

セッションのクッキー取得

  1. ssmjpのemojiページを開く
  2. 開発者ツール起動(ChromeなWindowsならF12)し、ネットワークタブを開く
  3. emojiページをリロードする
  4. "name"が"emoji"の項目を押す
  5. 新たに開いたタブから"Headers"を選ぶ
  6. "Request Headers"から"Cookie"の中身をコピーする
cp .env.sample .env
vim .env
.env
export SLACK_TEAM=ssmjp
export SLACK_COOKIE="(ダブルクオーテーションで囲って全部貼る)"
export SLACK_API_TOKEN=  #ここは空のまま
export EMOJI_DIR=

まずは一個登録

wget http://cultofthepartyparrot.com/parrots/parrot.gif

source .env
output
python upload.py parrot.gif
Processing parrot.gif.

Uploaded 1 emojis. (0 already existed)

これで:parrot:というemojiを追加できた。

いざ全部登録

gif画像取得

git clone https://github.com/jmhobbs/cultofthepartyparrot.com

プレフィックスを付ける

cd cultofthepartyparrot.com/parrots
for f in * ; do mv "$f" "parrot_$f" ; done

登録

.env
export EMOJI_DIR=../cultofthepartyparrot.com/parrots
source .env
python upload.py ${EMOJI_DIR}/*.gif
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2