alguna alma caritativa?
Código PHP:
function getShortURL($url) { $user = "username"; $akey = "apikey"; $path = "http://api.bit.ly/shorten?version=2.0.1"; $bitly = $path."&longUrl=".urlencode($url)."&login=".$user."&apiKey=".$akey; $data = file_get_contents($bitly); $json = new Services_JSON(); $obj = $json->decode($data); if ($obj->errorCode == 0) { return $obj->results->$url->shortUrl; } else { return false; } }
gracias