I\'m am looking for the MediaID of an Instagram image which has been uploaded. It should look like
1234567894561231236_33215652
In pure JS (provided your browser can handle XHRs, which every major browser [including IE > 6] can):
function igurlretrieve(url) {
var urldsrc = "http://api.instagram.com/oembed?url=" + url;
//fetch data from URL data source
var x = new XMLHttpRequest();
x.open('GET', urldsrc, true);
x.send();
//load resulting JSON data as JS object
var urldata = JSON.parse(x.responseText);
//reconstruct data as "instagram://" URL that can be opened in iOS app
var reconsturl = "instagram://media?id=" + urldata.media_id;
return reconsturl;
}
Provided this is your goal -- simply opening the page in the Instagram iOS app, which is exactly what this is about -- this should do, especially if you don't want to have to endure licensing fees.