Created
July 22, 2020 20:55
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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