surl is a URL shortening command line application that supports various sites. It supports stdin or filename input. It grabs the URLs, converts them, and returns the same text that was used in the input. It is known to work with a wealth of services, such as bit.ly, tinyurl.com, and others.
ExtConvLinks is a PHP class that can be used to convert URLs in text to links using Bit.ly. It can parse a text to find HTTP, HTTPS, FTP, and FTPS links. The class sends requests to the Bit.ly Web services API to convert the URLs that it finds into HTML links using the Bit.ly URLs.