Skip to content

Instantly share code, notes, and snippets.

@santisbon
Last active March 16, 2023 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save santisbon/1f659d682a8d02e68ef4d38fceb4368f to your computer and use it in GitHub Desktop.
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
# 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