Skip to content

Instantly share code, notes, and snippets.

View claylevering's full-sized avatar
🏠
Working from home

Clay Levering claylevering

🏠
Working from home
View GitHub Profile
@claylevering
claylevering / bitly.sh
Created February 15, 2012 02:20
Bit.ly Alfred App Extension
# 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|')