Created
November 16, 2022 18:37
-
-
Save emorydunn/492d7a68988470451321c3daa22386bf to your computer and use it in GitHub Desktop.
A function to download Slack reaction.
This file contains 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
function emoji --description 'Download an Emoji from Slack' | |
set url $argv | |
# Download the file | |
wget -q "$url" | |
# Parse the URL. | |
# Last component is the filename on the server | |
# Second to last is the emoji name in Slack | |
set urlComponents (string split "/" $url) | |
set oldName $urlComponents[-1] | |
set newName "$urlComponents[-2].png" | |
# Reame the file | |
mv "$oldName" "$newName" | |
echo "Downloaded '$newName' 🎉" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment