You can check Google API, but I'm not sure about that much bulk. I can suggest 3 solutions for you:
- Create short links on your host using PHP.
- Twitter will
shorten the URL for you if you tweet DIRECTLY. But, you cannot do it
using auto-posting. So, count characters (like
message + URL <= 140
) and keep your automatic tweets length less than 140 characters. You can also try this (Check the PHP Source Code Example)
function CompressURL($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://"."to.ly/api.php?longurl=".urlencode($url)); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_HEADER, 0); $shorturl = curl_exec ($ch); curl_close ($ch); return $shorturl; } echo CompressURL("http://twitter.com"); // Test