Created
January 10, 2017 13:28
-
-
Save iddan/452e1e95efad8d2d805de36585bd35d6 to your computer and use it in GitHub Desktop.
Extract Instagram Profile Images
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
// open Chrome Dev Tools | |
// go to the network tab | |
// open Instagram.com/:profile | |
// scroll until all the request images are displayed | |
// right click on one of the names to the left under the graph. | |
// choose "Save as HAR with content" | |
// save it as log.json | |
const extractMatch = (string, regexp, index) => | |
string.match(regexp) && string.match(regexp)[index]; | |
process.stdout.write( | |
JSON.stringify( | |
require('./log.json').log.entries | |
.filter(({ request: { url } }) => url === 'https://www.instagram.com/query/') | |
.map(({ response: { content: { text }}}) => JSON.parse(text)) | |
.filter(({ media }) => media) | |
.reduce((accumulator, { media: { nodes }}) => [...accumulator, ...nodes], []) | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use with Node 6+