Last active
December 8, 2021 06:46
-
-
Save tkroo/1aad6daa63c7fadd438ea5704d0d1080 to your computer and use it in GitHub Desktop.
grab instagram 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
javascript:( | |
function(){ | |
if(document.body.contains(document.getElementById("mydiv"))){ | |
document.getElementById("mydiv").remove() | |
} | |
var myobj=[...document.querySelectorAll("img.FFVAD")].reverse(); | |
var mydiv=document.createElement("div"); | |
mydiv.id="mydiv"; | |
mydiv.style.cssText='position:fixed; z-index:99999; padding:10px; max-height:300px; overflow-y:auto;'; | |
document.body.insertBefore(mydiv,document.body.firstChild); | |
var mycontent = ` | |
<div style='display:flex; flex-direction:row; flex-wrap:wrap; top:0; left:0; z-index:9999; background:pink; padding:10px;'> | |
<button | |
onclick='return this.parentNode.remove();' | |
style='position:fixed; top:0; left:0;background: #fff; border: .05rem solid #5755d9; border-radius: .1rem; color: #5755d9; cursor: pointer; display: inline-block; font-size: .8rem; height: 1.8rem; line-height: 1.2rem; outline: 0; padding: .25rem .4rem; text-align: center; text-decoration: none;'>CLOSE | |
</button> | |
`; | |
for( var i=0; i<myobj.length; i++) { | |
var myImg = new Image(); | |
myImg.src = myobj[i].src; | |
mycontent += ` | |
<a href="${myobj[i].src}" target="_blank" style="flex:1 1 200px; " title="${myImg.width} x ${myImg.height}"> | |
<img style="width:200px; border:1px solid #fff; " src="${myobj[i].src}"> | |
</a>` | |
} | |
mycontent+="</div>"; | |
mydiv.innerHTML=mycontent | |
}() | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment