I have a piece of (jQuery) ajax code that has been happily working for about 9 months until the last couple of weeks or so.
This code uses Instagr
I am not a jQuery expert. Putting aside the syntax error(s), could this be any use?
var publicUrl = "http://instagram.com/p/dAu7UPgvn0"; //photo
var publicUrl = "http://instagram.com/p/mOFsFhAp4f"; //video
var URL = "http://api.instagram.com/oembed?url="+publicUrl;
$(document).ready(function () {
$.ajax({
url: URL,
publicurl: publicUrl,
dataType: "jsonp",
cache: false,
success: function (response) {
success: function (response) {
var mediaSrc;
if (response.type === 'photo') {
mediaSrc = response.url;
} else {
mediaSrc = $(publicurl).find('div.Video vStatesHide Frame').src;
}
console.log(mediaSrc);
}
},
error: function () {
console.log("couldn't process the instagram url");
}
});
});