I'm trying to implement auto post on Twitter using PHP.
But because of twitt's character limit I wanted to know how can I use tinyURL, instead of placing the full link, like http://www.appdropp.com/ios/stone-age-the-board-game/564247778
You see it's quite long...
I know services like:
But how can I use these services in bulk, to generate hundreds of links every day with PHP?
You can check Google API, but I'm not sure about that much bulk. I can suggest 3 solutions for you:
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