Last active
June 27, 2016 20:43
-
-
Save marcelduran/8f624d289842a0f7f1bf374d76a39cbf to your computer and use it in GitHub Desktop.
Fotolog Image Dump
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
javascript:(function(){var a=document.createElement("iframe"),c=[];a.addEventListener("load",function(){var d=Array.prototype.slice.call(a.contentWindow.document.querySelectorAll(".wall_img_container img"));c=c.concat(d.map(function(a){return a.src}));if((d=Array.prototype.slice.call(a.contentWindow.document.querySelectorAll("#pagination a")).filter(function(a){return">"==a.innerHTML})[0])&&">"==d.innerText)d.click();else{a.parentNode.removeChild(a);var b=document.createElement("a");document.body.appendChild(b); var e=c.length.toString().length,f=Array(e).fill("0").join("");c.forEach(function(a,c){b.href=a.replace("_t.jpg","_f.jpg");b.innerText=b.download="img_"+(f+c).slice(-e)+".jpg";b.click()});b.parentNode.removeChild(b)}});a.src=location.href;document.body.appendChild(a)})(); |
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
(function(){ | |
var iframe = document.createElement('iframe'); | |
var allImgs = []; | |
iframe.addEventListener('load', function() { | |
var imgs = Array.prototype.slice.call(iframe.contentWindow.document.querySelectorAll('.wall_img_container img')); | |
allImgs = allImgs.concat(imgs.map(i=>i.src)); | |
var next = Array.prototype.slice.call(iframe.contentWindow.document.querySelectorAll('#pagination a')).filter(e=>e.innerHTML=='>')[0]; | |
var hasNext = next && next.innerText == '>'; | |
if (hasNext) { | |
next.click(); | |
} else { | |
iframe.parentNode.removeChild(iframe); | |
var link = document.createElement('a'); | |
document.body.appendChild(link); | |
var len = allImgs.length; | |
var lenW = len.toString().length; | |
var pad = Array(lenW).fill('0').join(''); | |
allImgs.forEach((url,index)=>{ | |
link.href = url.replace('_t.jpg', '_f.jpg'); | |
link.innerText = link.download = 'img_' + (pad + index).slice(-lenW) + '.jpg'; | |
link.click(); | |
}); | |
link.parentNode.removeChild(link); | |
} | |
}); | |
iframe.src = location.href; | |
document.body.appendChild(iframe); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment