<?php
 
/*************************
 
 * This is the example file for bit.ly Class. 
 
 * To use it, you have to register on bit.ly and
 
 * visit http://bit.ly/a/your_api_key here you can
 
 * find your login and api key you have to use in
 
 * the class.
 
 *
 
 * This example shows the usage of the class. There 
 
 * are two way: you give API key int the clsses 
 
 * private variables OR in the classes construct.
 
 *
 
 * After successful shortening you will see all
 
 * shortened URL in your bit.ly dashboard. 
 
**************************/
 
require_once 'bit.ly.class.php';
 
 
/*USE THIS METHOD IF API KEY PROVIDED INSIDE THE CLASS*/
 
//$test = new bitlyClass();
 
//echo $test->getShortURL('http://www.google.com');
 
 
$test = new bitlyClass('YOUR BIT.LY LOGIN','YOUR BIT.LY API KEY');
 
echo 'http://www.google.com shortened version: '.$test->getShortURL('http://www.google.com');
 
 
?>
 
 |