To get full URL on bit.ly, you need to register to developers API and create an app, than you can use expand method.
For goo.gl short links, sing in with Google account and register to API, and use expand method.
But best in your case would be longurl.org API, which has a simple method to expand URLs. Take a look at their expand-url documentation.
An example request to their API:
GET http://api.longurl.org/v2/services&format=json
and since you do not want to use PHP, than you need to ask for jsonp format this way:
GET http://api.longurl.org/v2/services&format=json&callback=foo&user-agent=Application-Name%2F3.7
So, alltogether, you need to expand url and get json this way:
GET http://api.longurl.org/v2/expand?url=http%3A%2F%2Fbit.ly%2F1uI7Ddj&format=json&callback=foo&user-agent=Application-Name%2F3.7
You get response:
foo({"long-url":"http:\/\/flark.it\/f\/i\/1884680242.WP_000008.jpg"})
Similar with jsonp
, read more about jsonp
There is also expandURL API, but I do not see they offer jsonp responses. Example there would be:
GET http://expandurl.appspot.com/expand?url=http%3A%2F%2Fbit.ly%2F1uI7Ddj
and you get json response:
{
"status": "OK",
"end_url": "http://flark.it/f/i/1884680242.WP_000008.jpg",
"redirects": 1,
"urls": ["http://bit.ly/1uI7Ddj",
"http://flark.it/f/i/1884680242.WP_000008.jpg"],
"start_url": "http://bit.ly/1uI7Ddj"
}