Needed a quick and easy way to create a bit.ly URL for another site of mine. Google came through for me.
David Walsh posted a short PHP function on his site that takes your bit.ly login, API key, and the URL to shorten and returns a nice, short bit.ly link.
Just put the function into your file and…
$shortURL = make_bitly_url($longURL, $bitlyLogin, $bitlyAPIKey);
And that’s it. A new bit.ly URL is created and stored in $shortURL for you.
I started using this on my @DailyFont Twitter feed today to post fonts as they’re added to the site and after a couple of test Tweets it seems to be working without a hitch.