[PYTHON] I tried using Slack emojinator

TL;DR

A story about automating emoji registration to slack.

Install Slack emojinator

https://github.com/smashwilson/slack-emojinator As written here.

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

Preparation for registering multiple emojis

emoji_irai.png

I just received such a request, so I tried it.

Get session cookies

  1. Open the emoji page of ssmjp
  2. Launch Developer Tools (F12 for Chrome Windows) and open the Network tab
  3. Reload the emoji page
  4. Press the item whose "name" is "emoji"
  5. Select "Headers" from the newly opened tab
  6. Copy the contents of "Cookie" from "Request Headers"
cp .env.sample .env
vim .env

.env


export SLACK_TEAM=ssmjp
export SLACK_COOKIE="(Enclose it in double quotes and paste it all)"
export SLACK_API_TOKEN=  #It remains empty here
export EMOJI_DIR=

First, register one

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

source .env

output


python upload.py parrot.gif
Processing parrot.gif.

Uploaded 1 emojis. (0 already existed)

You have now added an emoji called `` `: parrot: ```.

Register all

gif image acquisition

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

Prefix

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

Registration

.env


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

Recommended Posts

I tried using Slack emojinator
I tried using parameterized
I tried using argparse
I tried using mimesis
I tried using aiomysql
I tried using Summpy
I tried using Pipenv
I tried using matplotlib
I tried using ESPCN
I tried using openpyxl
I tried using Ipython
I tried using PyCaret
I tried using cron
I tried using ngrok
I tried using face_recognition
I tried using Jupyter
I tried using PyCaret
I tried using Heapq
I tried using doctest
I tried using folium
I tried using jinja2
I tried using folium
I tried using time-window
[I tried using Pythonista 3] Introduction
I tried using easydict (memo).
I tried face recognition using Face ++
I tried using Random Forest
I tried using BigQuery ML
I tried using Amazon Glacier
I tried using git inspector
I tried using magenta / TensorFlow
I tried using AWS Chalice
I tried using Rotrics Dex Arm
I tried using GrabCut of OpenCV
I tried using Thonny (Python / IDE)
I tried server-client communication using tmux
I tried reinforcement learning using PyBrain
Somehow I tried using jupyter notebook
I tried shooting Kamehameha using OpenPose
I tried using the checkio API
[Python] I tried using YOLO v3
I tried asynchronous processing using asyncio
I tried using Amazon SQS with django-celery
I tried using Azure Speech to Text.
I tried using Twitter api and Line api
I tried scraping
I tried PyQ
I tried playing a ○ ✕ game using TensorFlow
I tried using YOUTUBE Data API V3
I tried using Selenium with Headless chrome
I tried drawing a line using turtle
[Kaggle] I tried ensemble learning using LightGBM
I tried using PyEZ and JSNAPy. Part 2: I tried using PyEZ
I tried using Bayesian Optimization in Python
I tried to classify text using TensorFlow
I tried using Selective search as R-CNN
I tried AutoKeras
I tried using UnityCloudBuild API from Python
I tried papermill
I tried django-slack
I tried using Headless Chrome from Selenium