Skip to content

Instantly share code, notes, and snippets.

@AustinDizzy
Last active February 10, 2018 09:34
Show Gist options
  • Save AustinDizzy/7c4fdff0cdda5d8c504c to your computer and use it in GitHub Desktop.
Save AustinDizzy/7c4fdff0cdda5d8c504c to your computer and use it in GitHub Desktop.
a quick script that easily reads instagram DM structure and prints from data variable
var url = "https://instagram.com/api/v1/direct_share/inbox/";
$.getJSON(url, function(data){
for(var i = 0; i < data.shares.length; i++){
var post = data.shares[i];
console.log(post.caption.user.username + ": " + post.caption.text + "\nURL:" + post.image_versions[0].url+"\n");
for(var k = 0; k < post.comment_count; k++){
var comment = post.comments[k];
console.log("\t"+comment.user.username + ": " + comment.text + "\n");
}
console.log("========================\n");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment