Having chosen to convert a bunch of long URLs using bit.ly, I slightly modified and packaged in a simple PHP5 class the code written by David Walsh.
The following is an example of usage of this class:
$mbit = new BitlyWalsh($login, $apiKey);
echo $mbit->getShort($yourLongUrl);
// echo $mbit->getLong($bitlyShortUrl);
You can download here this basic class.
