Last active
May 21, 2019 15:08
-
-
Save John07/4409401 to your computer and use it in GitHub Desktop.
Tiny shell script for use with Textexpander to take a (Twitter) short URL and resolve it to the full URL
Add it to Textexpander as a shell script, copy the shortened URL, type your Textexpander command and then the full URL will be pasted in
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
#!/bin/bash | |
URL=$(pbpaste) | |
curl "$URL" --insecure --write-out %{redirect_url} |
Brett Terpstra has an even more elegant script here: http://brettterpstra.com/2010/08/14/is-your-url-too-short-try-our-system-free/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want it to work for bit.ly URLs too, change line 3 to