Skip to content

Instantly share code, notes, and snippets.

@iddan
Created January 10, 2017 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iddan/452e1e95efad8d2d805de36585bd35d6 to your computer and use it in GitHub Desktop.
Save iddan/452e1e95efad8d2d805de36585bd35d6 to your computer and use it in GitHub Desktop.
Extract Instagram Profile Images
// 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], [])
)
);
@iddan
Copy link
Author

iddan commented Jan 10, 2017

use with Node 6+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment