Skip to content

Instantly share code, notes, and snippets.

@emorydunn
Created November 16, 2022 18:37
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 emorydunn/492d7a68988470451321c3daa22386bf to your computer and use it in GitHub Desktop.
Save emorydunn/492d7a68988470451321c3daa22386bf to your computer and use it in GitHub Desktop.
A function to download Slack reaction.
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