Monday 10 June 2013

URL Shortening API

A free URL forwarding api service allowing anyone to take any existing URL and shorten it.  And it never expires


URL shortening services is common but playing important to our web developer life for advertising, publishing and sharing purposes. Short url also can make quick response code (QR)  easy to be scan or read by mobile devices. You need a url shortening services for your system or batch? He i come out with new url shoring api services to simplify your task without any authentications (like oauth). One more important thing, it's never expire.

You can go to pgurl.com to generate your own short url or calling http request by following sample.

I using jquery as coding sample.

var getShortUrl = function(yoururl){
var rurl = "http://pgurl.com/shorturl/create/?lurl=" + encodeURIComponent(yoururl) + "&q=*";
$.get(url, function(txt){
console.log(txt);
//put your coding here
});
return false;
}

i use http://easydeveloperlife.blogspot.com/ as sample and the api return as bellow:-

pgurl.com/6e4ea


Now you can call the url and redirect to my blogs. I using hash algorithm to make sure the url will not repeat or redundancy. You can requesting the api by any system or any programming languages to get your shorturl works. No need programing the function again. Simple, right?



No comments:

Post a Comment