Skip to content

Instantly share code, notes, and snippets.

@turnipsoup
Created July 22, 2020 20:55
Show Gist options
  • Select an option

  • Save turnipsoup/46031d4804cc3ee0c53107c589ab8bf2 to your computer and use it in GitHub Desktop.

Select an option

Save turnipsoup/46031d4804cc3ee0c53107c589ab8bf2 to your computer and use it in GitHub Desktop.
Script to download all the team logos for Jelle's Marble Runs from slackmoji.com
import requests
import bs4 as bs
import os
# Try and make a directory to store the emojis
target_dir = "./jmr-emojis/"
try:
os.mkdir(target_dir)
except:
pass
r = requests.get("https://slackmojis.com/")
soup = bs.BeautifulSoup(r.content, "lxml")
jmr = soup.find_all("li")
for li in jmr:
if "jmr" in "".join(li["class"]):
marble_name = li["title"]
marble_source = li.find("img")["src"]
# Download target emoji
download = requests.get(marble_source)
with open(f"{target_dir}{marble_name}.png", "wb") as image:
image.write(download.content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment