Skip to content

Instantly share code, notes, and snippets.

@lightster
Created July 13, 2014 23:19
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 lightster/d075307709824b40f93e to your computer and use it in GitHub Desktop.
Save lightster/d075307709824b40f93e to your computer and use it in GitHub Desktop.
Generate `wget`s to download photos from Instagram
// Run this from Chrome console when viewing
// a user's Instagram profile
var thumbnails
function loadThumbnails() {
if ($('.more-label').text().match('more')) {
$('.more-label').click()
setTimeout(function() {
loadThumbnails()
}, 1000)
} else {
thumbnails = $('.Image.iLoaded.iWithTransition.tThumbImage')
generateWgetCommands()
}
}
function generateWgetCommands() {
var thumbnail = thumbnails.get(0)
thumbnails.splice(0, 1)
thumbnail.click()
setTimeout(function() {
var img_src = $('.Image.iLoaded.iWithTransition.Frame').attr('src')
var timestamp = $('.ImageBlock.Voice.Story [class=timestamp]').attr('value')
var uploaded = new Date(timestamp * 1000)
console.log("wget -O '" + uploaded.toISOString().slice(0, 19).replace(/:/g, '-') + ".jpg' '" + img_src + "'")
$('.igDialogClose').click()
if (thumbnails.length > 0) {
generateWgetCommands()
}
}, 2000)
}
loadThumbnails()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment