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
# modified API url to align with changes to bit.ly requirements - @claylevering | |
# find the .alfredextension here: http://cl.ly/EEUK | |
declare -r API='https://api-ssl.bitly.com/v3/shorten' | |
declare -r LOGIN='yourlogin' | |
declare -r API_KEY='yourapi' | |
# add http scheme to URL if none is provided | |
longURL=$(printf "{query}" | sed -E -e 's|^.|http://&|' -e 's|^http://([a-zA-Z\-\.\+]+://)|\1|') | |