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, TheRealURL responds with "404 Not Found" with the body error)
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) }
);
Free usage of TheRealURL is limited to 2000 requests per IP per day. If you'd like a higher request quota - or for any feedback, questions etc - contact me at niryariv@gmail.com or leave a comment.
Nir Yariv, Apr 2009