Last active
February 10, 2018 09:34
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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