php code
<?
class shorte
{
public function __construct($apiKey)
{
$this->apiKey = $apiKey;
}
public function shortenURL($url)
{
$apiResponse = file_get_contents('http://api.***Marked As Spam******Marked As Spam******Marked As Spam******Marked As Spam******Marked As Spam******Marked As Spam******Marked As Spam******Marked As Spam******Marked As Spam******Marked As Spam***/s/'.$this->apiKey.'/'.$url);
$data = json_decode($apiResponse,true);
if(!empty($data['shortenedUrl']) && isset($data['shortenedUrl']) )
{
echo $data['shortenedUrl'];
}
}
}
php code
<?
include $_SERVER['DOCUMENT_ROOT'].'/api/shorte.api.php';
$sh = new shorte('APIKEY');
echo $sh->shortenURL('Long URL');
?>
Bookmarks