TheRealURL is built to be used as a web service. The URL is sent in the url= parameter, if no return format is specified the response is simply the unshortened URL:
http://therealurl.appspot.com?url=http://tinyurl.com/b => http://www.betshop.com(If the request fails for some reason, the string error is returned in place of the URL)
Adding format=json returns a JSON response. In addition to the unshortened URL, JSON responses also return the page title:
http://therealurl.appspot.com/?format=json&url=bit.ly/a => {"url": "http:\/\/www.apple.com\/", "title": "Apple"}
Adding a callback= parameter allows for cross site requests with JSONP. This jQuery (v >= 1.2) code remotely fetches an unshortened URL:
$.getJSON("http://therealurl.appspot.com?format=json&url=bit.ly/q&callback=?",
function(data){ alert(data.url) }
);
If you find uses for TheRealURL in your application, I'd love to hear about them. Please feel free to contact me at niryariv@gmail.com or leave a comment here.
Nir Yariv, Apr 2009