Skip to content

Instantly share code, notes, and snippets.

@marnitto
Created March 20, 2017 07:17
Show Gist options
  • Save marnitto/a68f71f70b49ad3bd933d339c82dea76 to your computer and use it in GitHub Desktop.
Save marnitto/a68f71f70b49ad3bd933d339c82dea76 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
import codecs
from bs4 import BeautifulSoup
import requests
html = requests.get('https://slackmojis.com/').text
soup = BeautifulSoup(html, 'html.parser')
emoji_db = {}
for column in soup.select('.emoji'):
name = column['title']
url = column.select('a')[0]['href']
emoji_db[name] = url.split('?')[0]
with codecs.open('slackemoji.yaml', 'wb') as f:
f.write('title: slackemoji\nemojis:\n'.encode('utf-8'))
for k in emoji_db:
content = ' - name: %s\n src: %s\n' % (k, emoji_db[k])
f.write(content.encode('utf-8'))
# Now you can use https://github.com/lambtron/emojipacks to bulk upload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment