Created
September 13, 2010 04:35
-
-
Save 0xnbk/576816 to your computer and use it in GitHub Desktop.
Get short urls for Twitter
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
<?php | |
function getTinyUrl($url) { | |
return file_get_contents("http://tinyurl.com/api-create.php?url=".$url); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Get short urls for Twitter
Are you on Twitter? If yes, you probably use a url shortener such as bit.ly or TinyUrl to share your favorite blog posts and links on the network.
This snippet take a url as a parameter and will return a short url.