Created
July 13, 2014 23:19
-
-
Save lightster/d075307709824b40f93e to your computer and use it in GitHub Desktop.
Generate `wget`s to download photos from Instagram
This file contains hidden or 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
// 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