Last active
March 16, 2023 15:47
-
-
Save santisbon/1f659d682a8d02e68ef4d38fceb4368f to your computer and use it in GitHub Desktop.
Grab a list of emojos (custom emoji) supported by a Mastodon instance. Sort it, and remove patterns you're not interested in. #mastodon #emoji
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
# Use your instance domain | |
DOMAIN=hachyderm.io | |
EXCLUDE="blob|yeen|another|yetanother" | |
# Create the script file | |
cat << EOF > ~/emojos.sh | |
curl 'https://emojos.in/${DOMAIN}' -o emojos.htm | |
# Case-insensitive, print only the match rather than the entire line. Sort. Deduplicate. Redirect to file. | |
grep -io ':[a-zA-Z0-9]*_*[a-zA-Z0-9]*:' emojos.htm | sort | uniq -d > emojos.txt | |
# Filter out patterns (case-insensitive delete) | |
sed -E '/${EXCLUDE}/Id' emojos.txt > emojos-filtered.txt | |
EOF | |
# Make it executable | |
chmod a+x emojos.sh | |
# Replace path to the script and link to somewhere on your $PATH | |
sudo ln -sf /path/to/emojos.sh /usr/local/bin/emojos | |
# Now you can just call the executable and find the results in emojos-filtered.txt | |
emojos |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment