Convert Url to Tiny Url

Tuesday, December 22nd, 2009

Sometimes you need to convert a url to a new one on the fly.  Tinyurl offers a very easy to use API to do that.  You can do it complicated with curl or you can just use file_get_contents and make it a one line function.

function ShortURL($ToConvert) {
$short_url= file_get_contents(“http://tinyurl.com/api-create.php?url=” . $ToConvert);
return $short_url;

}

Just call it with:

$newurl = ShortURL(‘http://www.linktoshorten.com/itsreallylong’);

Black Hat Digest Newsletter – A Must Read!

Popularity: 2% [?]

Leave a comment

Login with Facebook:

Who is New?

Once You Know, You Newegg

Facebook Activity

Become Our FaceBook Fan!

Facebook Fans

Last Users

Last users on Black Hat SEO Digest!